iOS设置主题颜色方便使用

来源:互联网 发布:网络机顶盒多少钱一个 编辑:程序博客网 时间:2024/06/05 05:45
  • 在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;
原创粉丝点击