我正在尝试针对 iOS 7 调整我的应用程序。我遇到的问题是我无法更改某些控件的色调。
我确实添加了
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
if (IOS7_OR_LATER)
self.window.tintColor = [self greenTintColor];
给我的应用委托(delegate)
- (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.
-来自苹果文档
您可以使用 tintColor 属性,或者您可以为此使用一些自定义库,您可以在 cocoacontrols.com 上找到它。
关于ios - 更改 UIAlertview 和 UIActionsheet 按钮的色调,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19994993/