iOS中让颜色赋值简单一点吧

在开发过程中,UE一般会给十六进制的颜色值,而如果RD同学每次都要去将十六进制进行转换,那太麻烦,这里写个预定义mark下。

#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

同时在开发的过程中,少不了要获取屏幕宽度高度,这里一并mark下

//屏幕高度
#define DeviceHeight [UIScreen mainScreen].bounds.size.height

//屏幕宽度
#define DeviceWidth [UIScreen mainScreen].bounds.size.width

  

原文地址:https://www.cnblogs.com/smallstong/p/4179483.html