iOS 8 Alertview 操作按钮颜色为白色

标签 ios objective-c ios8

alertView 操作按钮在 ios 7 之前都是蓝色的

但在 iOS 8 上,“确定”和“取消”为白色。

请找到创建警报 View 的代码块

+(UIAlertView*)showWithMessage:(NSString*)message withTitle:(NSString*)title {
    UIAlertView* alert = [[UIAlertView alloc] initWithTitle:title
                                                    message:message
                                                   delegate:nil
                                          cancelButtonTitle:tibbrLocalizedString(@"all_view.ok.button", @"Ok button title for alert")
                                          otherButtonTitles:nil];
    [alert show];
    return alert;
}

最佳答案

这是 UIAlertView 的默认行为。如果您需要任何自定义,您可以使用任何自定义 alertview 库,例如,

https://github.com/warrenm/AHAlertView

注意:UIAlertView 遵循 iOS 7.0 Onwards 的白色主题 https://developer.apple.com/library/ios/documentation/userexperience/conceptual/MobileHIG/Modal.html#//apple_ref/doc/uid/TP40006556-CH64-SW1

关于iOS 8 Alertview 操作按钮颜色为白色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25843417/

相关文章:

ios - 音频单元 V3 扩展 : Swift vs. Objective-C

ios - Storyboard View 树中的不可见 subview

ios - 如何在 objective-c 中实现 "didset of swift"?

ios - 以编程方式调用时,RefreshControl 的属性标题不显示

ios - Swift:使用 tableview 创建无限树

ios - 使用 Swift 播放随机音频文件

ios - 如何在 iOS 的 UITableViewCell 中播放视频(自动播放)

objective-c - 在 ImageView 中将数组绘制为图形

ios - 更改 SLComposeSheetConfigurationItem 的色调颜色/文本颜色

iOS 7/8 系统键盘高度