iOS 开发中渐变色的使用

    CAGradientLayer *lay = [CAGradientLayer layer];
    [lay setFrame:self.view.bounds];
    lay.colors = @[[UIColor redColor],[UIColor blueColor]];
    [self.view.layer insertSublayer:lay atIndex:0];

需要注意的是,渐变色的使用需要引入图形框架
posted @ 2015-04-29 10:56  沙影无痕  阅读(219)  评论(0编辑  收藏  举报