1.给UIView设置圆角,边框,阴影绘制,需要使用layer1)设置圆角cornerView.layer.cornerRadius = 20; //设置试图圆角的大小cornerView.layer.masksToBounds = YES //防止子元素溢出父试图将一个正方形设置成圆形,代码为.....
分类:
其他好文 时间:
2016-01-14 22:20:46
阅读次数:
317
1.绘制圆角cornerView.layer.cornerRadius = 20; //设置试图圆角的大小cornerView.layer.masksToBounds = YES //防止子元素溢出父试图将一个正方形设置成圆形,代码为:cornerView.layer.cornerRadius .....
分类:
其他好文 时间:
2016-01-14 16:11:06
阅读次数:
357
圆角sampleView.layer.cornerRadius = 2.5; // 圓角的弧度sampleView.layer.masksToBounds = YES;阴影sampleView.layer.shadowColor = [[UIColor blackColor] CGColor];sa...
分类:
移动开发 时间:
2016-01-09 20:04:04
阅读次数:
197
//设置图片框为圆角 ImgView.layer.cornerRadius = 7; ImgView.layer.masksToBounds = YES;//设置图片框为圆角 ImgView.layer.cornerRadius = 7; ImgView.layer.masksToBounds = ...
分类:
其他好文 时间:
2015-11-29 00:48:55
阅读次数:
102
对于UIview的圆角设置最简单的就是layer的两个属性分别是cornerRadius和masksToBounds,但是对于设置其中某一个角为圆角的时候需要使用贝塞尔曲线UIView *aView = [[UIView alloc] init];aView.frame = CGRectMake(0...
分类:
其他好文 时间:
2015-11-20 19:15:03
阅读次数:
112
设置Label的圆角效果// 设置Label为圆角// 设置四周圆角的半径lblMsg.layer.cornerRadius = 5;// 把多余的部分裁剪掉。lblMsg.layer.masksToBounds = YES;
分类:
其他好文 时间:
2015-11-05 22:05:04
阅读次数:
238
但是如果把masksToBounds设置为yes就没有阴影了UIButton*view=[[UIButtonalloc]initWithFrame:CGRectMake(100,100,100,100)];view.backgroundColor=[UIColorredColor];view.lay...
分类:
移动开发 时间:
2015-09-23 16:25:05
阅读次数:
170
UIView*view=[[UIViewalloc]initWithFrame:CGRectMake(100,100,100,100)];view.backgroundColor=[UIColorredColor];//设置圆角view.layer.cornerRadius=10;view.layer.masksToBounds=YES;//.设置边框view.layer.borderWidth=5;view.layer.borderColor=[UIColorgreenColor].CGCo..
分类:
其他好文 时间:
2015-09-16 16:00:53
阅读次数:
134
1. 设置圆角:self.view.layer.masksToBounds = YES;self.view.layer.cornerRadius = 10.0f;2. 添加边框:self.layer.borderWidth = 5.0f;self.layer.borderColor = [[UICo...
分类:
移动开发 时间:
2015-08-17 23:09:22
阅读次数:
151
imgLogo.layer.masksToBounds= YES; //设置在layer之下的都盖住 imgLogo.layer.cornerRadius = imgLogo.bounds.size.width*0.5; //设置layer的圆角,是自身宽度的一半 imgLogo.layer.bo....
分类:
其他好文 时间:
2015-07-28 12:38:40
阅读次数:
106