Button圆角

{    
// 给moreBtn 设置圆角
//方式一
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.moreBtn.bounds
                                               byRoundingCorners:UIRectCornerBottomLeft |UIRectCornerTopLeft
                                                     cornerRadii:CGSizeMake(10, 10)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = self.moreBtn.bounds;
maskLayer.path = maskPath.CGPath;

self.moreBtn.layer.mask = maskLayer;

//方式二
    //初始化 获取验证码Button描边颜色 圆角 描边宽度
//        self.moreBtn.layer.cornerRadius = 10;
    self.moreBtn.layer.borderWidth = 2;
    self.moreBtn.layer.borderColor = ZKColor(248, 99, 133).CGColor;    
//     self.moreBtn.backgroundColor = [UIColor redColor];

[super layoutSubviews];

}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容