当前位置: 移动技术网 > IT编程>移动开发>IOS > iOS-UIView指定圆角设置

iOS-UIView指定圆角设置

2018年04月17日  | 移动技术网IT编程  | 我要评论

狂野未婚夫,如何查询手机号码,cad机械制图视频教程

圆角设置可以指定左上、左下、右上、右下角;单个指定或多个指定。


///设置圆角[左上、右上角] - (void)setCircular{ UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(20,20)]; //创建 layer CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; maskLayer.frame = self.bounds; //赋值 maskLayer.path = maskPath.CGPath; self.layer.mask = maskLayer; }

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网