iOS UIView显示颜色渐变

-(void)colorWear:(UIView *)view{

CAGradientLayer *gradient = [CAGradientLayer layer];

gradient.frame =CGRectMake(0,0,view.frame.size.width,view.frame.size.height);

gradient.colors = [NSArray arrayWithObjects:

(id)[UIColor whiteColor].CGColor,

(id)[UIColor grayColor].CGColor,

(id)[UIColor whiteColor].CGColor,

nil];

[view.layer insertSublayer:gradient atIndex:0];

}

上一篇:JAVA内部类有关


下一篇:好记性不如烂笔头-linux学习笔记2kickstart自动化安装和cacti