UIView - CAGradientLayer
2013-12-13 16:05
267 查看
CAGradientLayer *layer = [[CAGradientLayer alloc] init]; layer.frame = self.bounds; //渐变转折点 layer.locations = @[@0, @0.25, @0.75, @1]; //渐变颜色,个数与locations一致 layer.colors = [NSArray arrayWithObjects:(id)[UIColor clearColor].CGColor, (id)[UIColor blackColor].CGColor, (id)[UIColor blackColor].CGColor, (id)[UIColor clearColor].CGColor, nil]; //起始位置和结束位置,控制渐变的变化方向 layer.startPoint = CGPointMake(0, 0.5); layer.endPoint = CGPointMake(1, 0.5); self.layer.mask = layer;
相关文章推荐
- [codility]equi
- 创建标题栏,UINavigationBar的使用
- radio控件name相同选出等于指定的value然后选中
- 查询SQL Server Index上次Rebuild时间
- 查询SQL Server Index上次Rebuild时间
- 给iOS开发新手送点福利,简述UISwitch的属性和用法
- HTC G14(G18)刷MIUI详细刷机教程
- 使用easyui 如何显示二级对象
- 给iOS开发新手送点福利,简述UISlide的属性和用法
- 《apue2e》(Unix环境高级编程——第二版)学习心得
- 给iOS开发新手送点福利,简述UIButton的属性和用法
- hibernate模型注解配置guid自动生成方式(非主键配置)
- 传智播客网页平面UI精品就业班、UI周末提高班学费调整公告
- HTC Desire Z刷MIUI图文刷机教程
- Caused by: org.hibernate.hql.ast.QuerySyntaxExcept
- solr FieldAnalysisRequestHandler 取得solr的分词方法
- [置顶] [Android源码分析]inquiry result引起的上层变化分析
- HTC Nexus One G5刷MIUI的详细刷机教程
- 在单线程模型中Message、Handler、MessageQueue、Looper之间的关系
- Android_BlockingQueue_并发线程