UIAlertView
和UIActionSheet
在iOS 8中無法正常顯示,它隱藏了視圖控制器,也未顯示警報視圖標題。我從Xcode 5.1.1運行應用程序。UIAlertView和UIActionSheet在iOS 8中無法正常顯示
5
A
回答
5
您是否在應用程序中爲ViewController添加了任何類別。如下圖所示
@implementation UIViewController (CustomeAction)
- (void)setTitle:(NSString *)title{
// YOU CODE///
}
@end
這可能是問題所在。我已通過刪除此類別來解決- (void)setTitle:(NSString *)title.
注意:從iOS 8開始,UIAlertViewController從UIViewController繼承。如果您使用分類方法,則會對UIAlertView標題產生影響。
0
應當注意的是,UIAlertView中和UIActionSheet被棄用的iOS 8.您可以檢查出this question或apple link。可能會幫助你。
0
參考蘋果的文檔您可以使用下面使用UIAlerController爲6的XCode和IOS 8
UIAlertController * alert= [UIAlertController
alertControllerWithTitle:@"Title"
message:@"Your Message"
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* ok = [UIAlertAction
actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
[alert dismissViewControllerAnimated:YES completion:nil];
}];
UIAlertAction* cancel = [UIAlertAction
actionWithTitle:@"Cancel"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
[alert dismissViewControllerAnimated:YES completion:nil];
}];
[alert addAction:ok];
[alert addAction:cancel];
[self presentViewController:alert animated:YES completion:nil];
對於ActionSheet
UIAlertController * alert= [UIAlertController
alertControllerWithTitle:@"Title"
message:@"Your Message"
preferredStyle:UIAlertControllerStyleActionSheet];
相關問題
- 1. UIActionSheet按鈕文本無法在ios 8中正確顯示
- 2. UIActionSheet不顯示在iOS 8中
- 3. 在UIActionSheet上顯示UIAlertView
- 4. iOS 8 UIAlertView不顯示按鈕
- 5. UIAlertView無法正常工作
- 6. ZBar SDK和相機無法在iOS中正常工作8
- 7. iOS 8 - 動畫顯示導航和狀態欄無法正常工作
- 8. iOS 8 UISplitViewController無法正常工作
- 9. iOS 8+中的橫向模式無法正確顯示
- 10. Xcode 8和iOS 10中的StoreKit無法正常工作
- 11. Recaptcha在Chrome中無法正常顯示
- 12. CSS在Chrome中無法正常顯示
- 13. 無法正常顯示
- 14. ngtable無法正常顯示
- 15. Datetimepicker無法正常顯示
- 16. Imges無法正常顯示
- 17. Tweet按鈕在IE7中無法正常顯示,但在Mozilla,Chrome和IE 8中正常工作
- 18. iOS 8在UIActionSheet中破解了UIPickerView
- 19. 如何在iOS 8上顯示沒有按鈕的UIAlertView?
- 20. 無法讓UIAlertView正常工作
- 21. iOS 8方向更改:鍵盤框無法正確顯示
- 22. 將UIActionsheet添加到UIAlertView中
- 23. 播放列表在IE和Chrome中無法正常顯示
- 24. iOS 8:UIAlertView/UIAlertController不顯示文本或按鈕
- 25. 無法在iOS 8
- 26. 顯示方法無法正常工作
- 27. Xcode 8在ios 10設備上無法正常工作
- 28. 「addDependency」在iOS中無法正常工作
- 29. NStimer在iOS中無法正常工作
- 30. 在UIAlertView iOS 8 beta 5中無標題的UI問題
偉大的...它的做工精細碼...感謝 – Surfer 2014-09-23 11:45:11
的歡迎,如果你需要設置標題,那麼你可以編寫UINavigationItem的類別。 – Nookaraju 2014-09-23 12:05:23
好的。非常感謝你.. – Surfer 2014-09-23 12:09:45