1

我一直在試圖解決這一整天,我升級我的mainWindow.xib到4英寸的iPhone 5版本,並且我的所有ActionSheets在4英寸模擬器上都表現正常。但是,如果我取消在3.5英寸設備上以縱向模式撰寫電子郵件,則操作單未完全顯示(取消按鈕已隱藏)。取消MFMailComposeViewController的ActionSheet截圖

我很感激提供的任何幫助。

這是問題的人像截圖:

a busy cat

這裏是我用來顯示操作板和反行爲爲3.5英寸的屏幕尺寸的代碼,由於我的主窗口.xib現在是4英寸版本:

sheet = [[UIActionSheet alloc] initWithTitle:nil 
               delegate:self 
             cancelButtonTitle:@"Cancel" 
            destructiveButtonTitle:nil 
             otherButtonTitles:@"Share via iMessage/SMS", @"Share via E-Mail", @"Review App", nil]; 

      // This code is for the iPhone 5 portrait & landscape, 3.5" landscape, and iPad 

      if ([[UIScreen mainScreen] applicationFrame].size.height == 548 | orientation == UIInterfaceOrientationLandscapeLeft | orientation == UIInterfaceOrientationLandscapeRight | UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 
      { 
       [sheet showInView:self.parentViewController.view]; 
      } 

      // This code is for 3.5" portrait 

      else 
      { 
       [sheet showInView:self.parentViewController.view]; 
       [sheet setFrame:CGRectMake(0, 220, 320, 320)]; 
      } 

回答

4

找到解決方案;我必須將mainWindow.xib大小更改爲None,並在我的應用程序代理中添加以下行:

self.window.frame = CGRectMake(0, 0, [[UIScreen mainScreen]bounds].size.width, [[UIScreen  mainScreen]bounds].size.height);