ios – 更改UIAlertview和UIActionsheet按钮的色调颜色

我正在尝试为iOS 7调整我的应用程序.我遇到的问题是我无法更改某些控件的色调颜色.

我添加了

self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
if (IOS7_OR_LATER)
    self.window.tintColor = [self greenTintColor];

到我的应用代表的

- (BOOL)application:(UIApplication *)application
 didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

它主要有所帮助,但消息框和操作表按钮的颜色仍然是默认的蓝色.

我怎样才能重新着色所有这些按钮呢?

一些截图:

解决方法

由于UIAlertView已弃用,您可以.使用UIAlertController.

您可以使用tintColor属性.

The UIAlertView class is intended to be used as-is and does not
support subclassing. The view hierarchy for this class is private and
must not be modified.

– 来自Apple Doc

您可以使用tintColor属性或您可以使用某些自定义库,您可以在cocoacontrols.com上找到它.

以上是来客网为你收集整理的ios – 更改UIAlertview和UIActionsheet按钮的色调颜色全部内容,希望文章能够帮你解决ios – 更改UIAlertview和UIActionsheet按钮的色调颜色所遇到的程序开发问题。

如果觉得来客网网站内容还不错,欢迎将来客网网站推荐给程序员好友。