宏定义如下:
#define HexColor(s) [UIColor colorWithRed:(((s & 0xFF0000) >> 16))/255.0green:(((s &0xFF00) >>8))/255.0blue:((s &0xFF))/255.0alpha:1.0]
使用:
view.backgroundColor = HexColor(0xFFFFFF);
宏定义如下:
#define HexColor(s) [UIColor colorWithRed:(((s & 0xFF0000) >> 16))/255.0green:(((s &0xFF00) >>8))/255.0blue:((s &0xFF))/255.0alpha:1.0]
使用:
view.backgroundColor = HexColor(0xFFFFFF);