UIAlertView和UIButton在白色背景上有白色按钮

时间:2014-11-19 10:10:13

标签: ios objective-c

将开发iPhone 5升级到iOS 8.1后,UINavigationBars和UIAlertViews上的所有按钮和默认标签开始以白色文字显示在屏幕上。

我尝试用以下方法解决问题:

// UIView tints
[[UIView appearance] setTintColor:[UIColor blackColor]];
[[UIAlertView appearance] setTintColor:[UIColor blackColor]];
[[UINavigationBar appearance] setBarTintColor:[UIColor blackColor]];
[[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]];

在大多数情况下,它以某种方式解决了白色按钮,但并非全部都解决了。在使用导航栏按钮和标签收到应用内通知后出现警报视图时,我仍然遇到问题。

有没有人遇到过这个问题?如果可能的话有解决方案吗?

White buttons on UIAlertView

1 个答案:

答案 0 :(得分:0)

无法自定义 UIAlretView 的外观:

[[UIAlertView appearance] setTintColor:[UIColor blackColor]];

查看class reference中的Apple备注:

  

子类注释

     

UIAlertView类旨在按原样使用   并且不支持子类化。此类的视图层次结构是   私人,不得修改。

可能重复的问题:Change tint color of UIAlertview and UIActionsheet buttons

相关问题