标签:
1.绘制圆角
cornerView.layer.cornerRadius = 20; //设置试图圆角的大小
cornerView.layer.masksToBounds = YES //防止子元素溢出父试图
将一个正方形设置成圆形,代码为:
cornerView.layer.cornerRadius = cornerView.frame.size.height/2;
cornerView.layer.masksToBounds = YES;
2.绘制边框
borderView.layer.borderWidth = 1.0; //绘制边框的大小
borderView.layer.borderColor = [UIColor blackColor].CGColor; //边框的颜色
3.绘制阴影
shadowView.layer.shadowColor = [UIColor redColor].CGColor;
shadowView.layer.shadowOffset = CGSizeMake(5.0, 5.0);
shadowView.layer.shadowOpacity = YES;
标签:
原文地址:http://www.cnblogs.com/LE-Quan/p/5130098.html