如何在XCode界面构建器中更改全局默认色调颜色?
在“实用程序”面板的“文件检查器”选项卡中,右侧可以找到有关大小类,自动布局和故事板的全局色调的控件 .
Interface Builder Way :选择要设置默认色调的Storyboard或Xib文件 .
然后在第一个选项卡上的Utilities中,File Inspector查找Interface Builder Document部分,您将看到如下图所示的Global Tint .
(发布图片的声誉不够)
Programmatically :
对象C: [[[[UIApplication sharedApplication] delegate] window] setTintColor:[UIColor orangeColor]];
[[[[UIApplication sharedApplication] delegate] window] setTintColor:[UIColor orangeColor]];
斯威夫特: UIWindow(frame: UIScreen.mainScreen().bounds).tintColor = UIColor.orangeColor()
UIWindow(frame: UIScreen.mainScreen().bounds).tintColor = UIColor.orangeColor()
您可以为整个窗口设置默认色调颜色:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { window = UIWindow(frame: UIScreen.mainScreen().bounds) window?.tintColor = UIColor(red: 1, green: 0, blue: 0, alpha: 1) return true }
您可以使用以下设置默认外观设置:
UIButton.appearance().tintColor = UIColor.orangeColor()
如果你把它放在:
application:didFinishLaunchingWithOptions:
只有它适用于整个应用程序 . 除非你在链中降低它,即在UIViewController中
viewDidLoad:
4 回答
在“实用程序”面板的“文件检查器”选项卡中,右侧可以找到有关大小类,自动布局和故事板的全局色调的控件 .
Interface Builder Way :选择要设置默认色调的Storyboard或Xib文件 .
然后在第一个选项卡上的Utilities中,File Inspector查找Interface Builder Document部分,您将看到如下图所示的Global Tint .
(发布图片的声誉不够)
Programmatically :
对象C:
[[[[UIApplication sharedApplication] delegate] window] setTintColor:[UIColor orangeColor]];
斯威夫特:
UIWindow(frame: UIScreen.mainScreen().bounds).tintColor = UIColor.orangeColor()
您可以为整个窗口设置默认色调颜色:
您可以使用以下设置默认外观设置:
如果你把它放在:
只有它适用于整个应用程序 . 除非你在链中降低它,即在UIViewController中