iOS设置主题颜色方便使用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_33351713/article/details/76296452
  • 在AppDelegate.h文件中声明一个全局变量:
    @property UIColor *zhuTiColor;
  • 在AppDelegate.m中,添加:@synthesize zhuTiColor;
  • 然后在
  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions 中添加:
    zhuTiColor=[UIColor colorWithRed:0x00/255.0 green:0xb2/255.0 blue:0xee/255.0 alpha:1];
  • 在需要使用的地方:
    bt.backgroundColor=delegate.zhuTiColor;

猜你喜欢

转载自blog.csdn.net/qq_33351713/article/details/76296452
今日推荐