标签:style blog http color io os ar sp div
颜色设置:
指定RGB,參数是:红、绿、黄、透明度,范围是0-1
+ (UIColor *)colorWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;
+ (UIColor *)colorWithHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha;
UIColor *color = [UIColor redColor]; UIColor *cl = [color colorWithAlphaComponent:0.5f];
CGFloat R = (CGFloat) 225/255.0; CGFloat G = (CGFloat) 66/255.0; CGFloat B = (CGFloat) 88/255.0; CGFloat alpha = (CGFloat) 1.0; UIColor *myColorRGB = [ UIColor colorWithRed: R green: G blue: B alpha: alpha ]; self.tableView.backgroundColor = myColorRGB;
最后附上
UIColor官方API文档:
+ colorWithWhite:alpha:
+ colorWithHue:saturation:brightness:alpha:
+ colorWithRed:green:blue:alpha:
+ colorWithCGColor:
+ colorWithPatternImage:
+ colorWithCIColor:
– colorWithAlphaComponent:
– initWithWhite:alpha:
– initWithHue:saturation:brightness:alpha:
– initWithRed:green:blue:alpha:
– initWithCGColor:
– initWithPatternImage:
– initWithCIColor:
+ blackColor
+ darkGrayColor
+ lightGrayColor
+ whiteColor
+ grayColor
+ redColor
+ greenColor
+ blueColor
+ cyanColor
+ yellowColor
+ magentaColor
+ orangeColor
+ purpleColor
+ brownColor
+ clearColor
标签:style blog http color io os ar sp div
原文地址:http://www.cnblogs.com/lcchuguo/p/4009390.html