目標C
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window.tintColor = [UIColor whiteColor];
return YES;
}
OR
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if([UINavigationBar conformsToProtocol:@protocol(UIAppearanceContainer)]) {
[UINavigationBar appearance].tintColor = [UIColor whiteColor];
}
return YES;
}
// ****************** ************************************************** *********
斯威夫特
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
self.window?.tintColor = UIColor.white
return true
}
或
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
if UINavigationBar is UIAppearanceContainer {
UINavigationBar.appearance().tintColor = UIColor.white
}
return true
}
變化碼如果([UINavigationBar的conformsToProtocol:@protocol(UIAppearanceContainer)]){ [UINavigationBar的外觀] .tintColor = [的UIColor whiteColor]; } – iOS
@Jigar我必須設置[[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]];'因爲當用戶點擊發送到郵件時。按鈕將默認設置爲藍色,導航欄顏色也爲藍色。所以它不會看到這個按鈕 – Oniikal3