在IOS里 不能像Css那样 可以使用 十六进制 如#f6f6f5
把这个十六进制手工计算转为十进制后 哈哈
使用UIColor *testColor1= [UIColor colorWithRed:245/255.0 green:246/255.0 blue:245/255.0 alpha:1];
就可以了.也可以用系统自带的工具,数码测色计 去测一个区域而得到RGB值
还可以用用Photoshop 把已知的十六进制颜色值 转为 RGB
总之就是 把已知的颜色值 转为RGB颜色值 就可以使用
方法:UIColor *testColor1= [UIColor colorWithRed:245/255.0 green:246/255.0 blue:245/255.0 alpha:1];
UIColor 定义了许多静态方法,能够方便的得到一些已经自定义好的颜色,使用起来比较方便,
如:
UIColor blackColor
UIColor darkGrayColor
UIColor lightGrayColor
UIColor whiteColor
UIColor grayColor
UIColor redColor
UIColor greenColor
UIColor blueColor
UIColor cyanColor
UIColor yellowColor
UIColor magentaColor
UIColor orangeColor
UIColor purpleColor
UIColor brownColor
UIColor clearColor
UIColor lightTextColor
UIColor darkTextColor
UIColor groupTableViewBackgroundColor
UIColor viewFlipsideBackgroundColor
UIColor scrollViewTexturedBackgroundColor
UIColor underPageBackgroundColor