首页 > 其他 > 详细

将view指定的角设置为圆角

时间:2016-04-20 19:55:55      阅读:262      评论:0      收藏:0      [点我收藏+]
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 80, 80)]; 
view.backgroundColor = [UIColor redColor]; 
[self.view addSubview:view];

 UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:view.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(5, 5)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; 
maskLayer.frame = view.bounds; 
maskLayer.path = maskPath.CGPath; 
view.layer.mask = maskLayer;    

将view指定的角设置为圆角

原文:http://www.cnblogs.com/siasyl/p/5413909.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!