标签:btn path mask bezier edr top 颜色 bounds bottom
无边框线
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.openGroupBtn.bounds byRoundingCorners:UIRectCornerTopRight | UIRectCornerBottomRight cornerRadii:CGSizeMake(radius,radius)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = self.openGroupBtn.bounds;
maskLayer.path = maskPath.CGPath;
self.openGroupBtn.layer.mask = maskLayer;
有边框线
UIBezierPath *rectPath=[UIBezierPath bezierPathWithRoundedRect:self.spellNumBtn.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerBottomLeft cornerRadii:CGSizeMake(radius, radius)];
CAShapeLayer *rectLayer=[CAShapeLayer layer];
//线条颜色
rectLayer.strokeColor=[UIColor colorWithHex:goldenYellow].CGColor;
//填充颜色
rectLayer.fillColor=[UIColor colorWithHex:CenColor].CGColor;
//线条宽度
rectLayer.lineWidth=1;
//起始结束点的样式
rectLayer.lineJoin=kCALineJoinRound;
//线条拐角的样式
rectLayer.lineCap=kCALineCapRound;
rectLayer.path=rectPath.CGPath;
[self.spellNumBtn.layer addSublayer:rectLayer];
标签:btn path mask bezier edr top 颜色 bounds bottom
原文地址:http://www.cnblogs.com/idefei/p/7607150.html