2009-10-29 36 views
0

我有一個UIActionSheet彈出一旦我的iPhone應用程序中的初始視圖加載,如果有數據可以同步回到Web服務。問題在於UIActionSheet彈出太高 - 標籤欄的一半暴露在操作表下。我不知道這是由造型造成的?任何人都可以提供解釋/解決方案來防止這種情況發生?!UIActionView錯誤地顯示

在此先感謝您的任何建議,我的代碼下面顯示...

- (void)viewDidLoad { 

    //...preset a few values here, unrelated to the view... 
    //... 

    // Add an actionsheet to prompt for a DB sync 
    if ([myDatabase isSyncPossible] == true) { 
     UIActionSheet *actionsheet = [[UIActionSheet alloc] 
      initWithTitle: @"You have information that hasn't been uploaded, would you like to sync now?" 
      delegate: self 
      cancelButtonTitle: @"No thanks, maybe later" 
      destructiveButtonTitle: @"Yes, upload now" 
      otherButtonTitles: nil]; 
     actionsheet.tag = 2; 
     [actionsheet showInView:self.view]; 
     [actionsheet release]; 
    } 
} 

回答

0

假設我正確理解了你的描述,這聽起來像'self.view'的框架不會在標籤欄下一直運行,而只是半途而廢。由於操作表從視圖的底部繪製,它將從該視圖的任何位置開始。修復使'self.view.frame'進入屏幕底部。

屏幕截圖會有幫助。

+0

感謝您的答覆,並花時間幫助我! 視圖大小確實是錯誤的,不知道爲什麼這在界面中不明顯,但糾正它確實解決了這個問題。非常感謝! – Purpletoucan

2

對於showInView:通話,請嘗試使用,而不是你的控制器的視圖導航視圖或標籤欄視圖。

+0

感謝您的評論。從導航視圖中呈現我的UIActionSheet解決了我的問題。 –