I am trying to adapt my application for iOS 7. The issue I am having is I can not change the tint color of some controls.
I did add
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
if (IOS7_OR_LATER)
self.window.tintColor = [self greenTintColor];
to my app delegate's
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
It mostly helped but color of message box and action sheet buttons is still the default blue.
How can I recolor all such buttons too?
Some screenshots:
As
UIAlertView
is deprecated You can. UseUIAlertController
.You can use
tintColor
property.OLD
-From Apple Doc
You can use tintColor property or You can use Some Custom Library for that, you can find it at cocoacontrols.com.
for UIAlertView with colored buttons you can use the cocoapod "SDCAlertView"
about CocoaPods: http://www.cocoapods.org
how to install CocoaPods: https://www.youtube.com/watch?v=9_FbAlq2g9o&index=20&list=LLSyp50_buFrhXC0bqL3nfiw
I was able to change the cancel button's text color to white in app delegate.
In iOS 6.0 create custom view in App delegate
For Actionsheet You can use
Utilize the willPresentActionSheet delegate method of UIActionSheet to change the action sheet button color.
Combining best answers above, and updated for deprecation:
or Swift:
Works in 2018, Swift 4 / iOS 12.