//----------第一种方法-------------------// _img.layer.cornerRadius = 150;// _img.layer.masksToBounds = YES;// _img.layer.contents = [UIImage imageName...
分类:
其他好文 时间:
2015-07-02 17:21:09
阅读次数:
120
cell.myimage.layer.masksToBounds=YES;
cell.myimage.layer.cornerRadius=cell.myimage.frame.size.width/2;
//dispatch_async会向kBgQueue队列中添加新的任务去执行,这里kBgQueue队列使用dispatch_get_global_queue(DISPATCH...
分类:
其他好文 时间:
2015-06-08 13:24:44
阅读次数:
91
cell.myimage.layer.masksToBounds=YES;
cell.myimage.layer.cornerRadius=cell.myimage.frame.size.width/2;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
...
分类:
移动开发 时间:
2015-06-08 11:42:15
阅读次数:
198
将lable设置成圆角的方法
第一步先添加框架:QuartzCore,frame
label.layer.cornerRadius = 10;
label.layer.masksToBounds = YES;
利用控件尺寸和圆角半径创建圆,半径为50的圆
Label.frame = CGRectMake(0,0,100,100);
label.layer.cornerRadius...
分类:
其他好文 时间:
2015-05-14 08:44:58
阅读次数:
118
//1.圆角//只给父层倒圆角无效imgView.layer.cornerRadius = 100;//此属性可以让UIImageView的所有子图层父图层一起变化//imgView.layer.masksToBounds = YES;//2.阴影imgView.layer.shadowColor ...
分类:
其他好文 时间:
2015-04-13 22:33:34
阅读次数:
127
1. 设置UITextView框为圆角
_textView.layer.cornerRadius =
6;
_textView.layer.masksToBounds =
YES;...
分类:
其他好文 时间:
2015-03-14 15:29:47
阅读次数:
158
以前在给View Image View Button 设置边框 和 圆角 的时候 一直不明白 为什么要设置button.layer.masksToBounds = YES 现在终于知道原因了
当你了解了masks 的时候就会明白为什么会有这一步操作了 “一个图层可以有一个和它相
关联的mask(蒙版)mask 是一个拥有alpha值的位图,当像素要和它下面包含的像素合并
...
分类:
其他好文 时间:
2015-03-05 17:05:38
阅读次数:
129
1、绘制圆角 cornerView.layer.cornerRadius = 20; cornerView.layer.masksToBounds = YES;masksToBounds防止子元素溢出父视图。如果一个正方形要设置成圆形,代码为: cornerView.layer.c...
分类:
其他好文 时间:
2015-03-02 12:59:38
阅读次数:
118
* 当你发现使用cornerRadius不管用时,试试`view.layer.masksToBounds = YES;`,[Read more.](http://stackoverflow.com/a/22348469/1388881) * 不像在Android下,iOS里面想搞个点击除了button方便点,其他View着...
分类:
移动开发 时间:
2014-11-26 11:43:04
阅读次数:
208
//@mg:masksToBounds必须为NO否者阴影没有效果// cell.layer.masksToBounds = NO; cell.layer.contentsScale = [UIScreen mainScreen].scale; cell.layer.shadowOpacity...
分类:
其他好文 时间:
2014-11-12 16:20:50
阅读次数:
160