iOS 设置左上和左下为圆角方法
2016-11-22 09:56
302 查看
1.先定义一个 label
2.//左上&左下为圆角
UIBezierPath * maskPath = [UIBezierPath bezierPathWithRoundedRect:label.bounds byRoundingCorners:UIRectCornerBottomLeft|UIRectCornerTopLeft cornerRadii:CGSizeMake(3, 3)];
CAShapeLayer * maskLayer = [[CAShapeLayer alloc]init];
maskLayer.frame = label.bounds;
maskLayer.path = maskPath.CGPath;
label.layer.mask = maskLayer;
2.//左上&左下为圆角
UIBezierPath * maskPath = [UIBezierPath bezierPathWithRoundedRect:label.bounds byRoundingCorners:UIRectCornerBottomLeft|UIRectCornerTopLeft cornerRadii:CGSizeMake(3, 3)];
CAShapeLayer * maskLayer = [[CAShapeLayer alloc]init];
maskLayer.frame = label.bounds;
maskLayer.path = maskPath.CGPath;
label.layer.mask = maskLayer;
相关文章推荐
- iOS 圆角 圆形头像 设置方法
- iOS设置圆角图片的方法及对比
- iOS开发--UIButton 设置圆角 边框颜色 点击回调方法
- iOS设置圆角的三种方法
- iOS: 使用故事板和xib设置按钮圆角方法
- iOS 设置圆角通用方法
- iOS学习——UIView圆角图片的设置方法
- IOS--UIViewUIButtonUIImageView设置圆角、阴影、边框的方法
- iOS设置圆形(圆角)UIView、UIButton的简单方法
- iOS中设置圆角的几种方法示例
- iOS设置圆角的四种方法
- iOS设置圆角的四种方法
- iOS设置圆角的四种方法
- iOS开发中设置圆角的方法
- iOS应用开发中UIView添加边框颜色及设置圆角边框的方法
- iOS UIButton 给某个角设置为圆角的方法
- IOS--UIViewUIButtonUIImageView设置圆角、阴影、边框的方法
- iOS切圆角的方式 第一种方法:通过设置layer的属性 最简单的一种,但是很影响性能,一般在正常的开发中使用很少. UIImageView *imageView = [[UIImag
- ios:设置视图背景图片的方法
- ios 设置屏幕方向的两种方法