如图所示.png
UIButton * maBtn = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - 110, (260*W-30)/2, 110, 30)];
maBtn.backgroundColor = BaseColor;
[bg addSubview:maBtn];
//TODO:uiview 单边圆角或者单边框
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:maBtn.bounds byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerBottomLeft) cornerRadii:CGSizeMake(maBtn.frame.size.height/2,maBtn.frame.size.height/2)];//圆角大小
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = maBtn.bounds;
maskLayer.path = maskPath.CGPath;
maBtn.layer.mask = maskLayer;
需要的人可以直接copy走吧!记得帮我点点❤ 爱你哟!
网友评论