码迷,mamicode.com
首页 > 其他好文 > 详细

视图切圆角.. 每一个角

时间:2015-12-04 18:20:00      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:

   UIBezierPath * bezierPath = [UIBezierPath bezierPathWithRoundedRect:skinSource.bounds byRoundingCorners:UIRectCornerBottomRight | UIRectCornerTopRight cornerRadii:CGSizeMake(14, 14)];
    CAShapeLayer *maskLayer = [CAShapeLayer layer];
    maskLayer.frame = skinSource.bounds;
    maskLayer.path = bezierPath.CGPath;
    skinSource.layer.mask = maskLayer;
 
typedef NS_OPTIONS(NSUInteger, UIRectCorner) {
    UIRectCornerTopLeft     = 1 << 0,
    UIRectCornerTopRight    = 1 << 1,
    UIRectCornerBottomLeft  = 1 << 2,
    UIRectCornerBottomRight = 1 << 3,
    UIRectCornerAllCorners  = ~0UL
};

视图切圆角.. 每一个角

标签:

原文地址:http://www.cnblogs.com/tian-sun/p/5019921.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!