UI布局画分割线
2015-12-20 19:49
477 查看
UI布局中有很多需要画线条,我们一般做法一个是在Xib 上拖出一个UIView 控件,然后将高度设为1
但是这样做是达不到系统线条那种效果,看起来比较粗
这里提供一种方式 将线条加在Layer 上面
但是这样做是达不到系统线条那种效果,看起来比较粗
这里提供一种方式 将线条加在Layer 上面
CGColorRef borderColor = [UIColor colorWithHexString:@"#DEDEDE"].CGColor; CALayer *vLine = [CALayer layer]; vLine.frame = CGRectMake(12, 176, [UIScreen mainScreen].bounds.size.width - 24, 0.5); vLine.backgroundColor = borderColor; [self.view.layer addSublayer:vLine];
相关文章推荐
- UESTC 482 Charitable Exchange(四川省赛B题)
- 为什么Java中1000==1000为false而100==100为true?(Integer)
- 第1章 使用视图UI组件
- 使用Roboguice依赖注入规划Android项目
- iOS开发——UISearchController实现搜索栏功能|阳和移动开发
- UESTC 1272 Final Pan's prime numbers 猜答案、乱搞题、数论
- UITableViewCell中如何添加图片数组
- UESTC 1269 ZhangYu Speech 预处理、前缀和
- 区别linq查询中的IEnumerable<T>和IQueryable<T>
- 绑定UI使用说明
- php判断mysql_query是否成功执行
- ios build时,Undefined symbols for architecture xxx问题的总结
- 造轮子_MVC+EF(CodeFirst)+Easyui医药MIS系统
- 【APUE】7、signal函数
- UITabelViewCell高度的自适应
- [LeetCode] 303. Range Sum Query - Immutable (Easy)
- UILabel,UIButton,UITextField的简单使用
- iOS 之 UITextField
- [How to] UIScrollView的使用方法
- iOS UICollectionView简单使用