最近、私は最終的に1つのレガシープロジェクトをリファクタリングし、すべてUIAlertViews
とUIActionSheets
をUIAlertControllers
に変更しました。しかし、私は顧客からの問題を受け取るようになった、彼らは時々UIAlertController
アクションタイトルが空白であると言っている。その方法のように:UIAlertControllerはUIAlertActionsの空白のタイトルを表示します
私は、あなたが可能な理由についてどんな考えを持っていない、私のデバイス上でこのバグを再現することはできませんか?
UPDATE:
私は信じて、その問題は多分、メインウィンドウのtintColorは何とかデフォルトではない、とUIAlertController
はそれを継承し、そのコードに覆われていますか?
@implementation UIAlertController (WMC)
- (void)show:(BOOL)animated {
self.alertWindow = [[UIWindow alloc] initWithFrame:[UIScreen
mainScreen].bounds];
self.alertWindow.rootViewController = [[UIViewController alloc] init];
id<UIApplicationDelegate> delegate = [UIApplication sharedApplication].delegate;
// Applications that does not load with UIMainStoryboardFile might not have a window property:
if ([delegate respondsToSelector:@selector(window)]) {
// we inherit the main window's tintColor
self.alertWindow.tintColor = delegate.window.tintColor;
}
// window level is above the top window (this makes the alert, if it's a sheet, show over the keyboard)
UIWindow *topWindow = [UIApplication sharedApplication].windows.lastObject;
self.alertWindow.windowLevel = topWindow.windowLevel + 1;
[self.alertWindow makeKeyAndVisible];
[self.alertWindow.rootViewController presentViewController:self animated:animated completion:nil];
}
@end
いくつかのコードを試してみることができますか? –
例:http://hayageek.com/uialertcontroller-example-ios/ –