我正在尝试为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上找到它.