我试图设置按钮底部的圆角矩形。但他们只适用于底部的权利。如何设置RoundedRectagle的cornerRadius只有UIButton的左下角,右下角?
我希望双方的按钮底部有圆角矩形。 这是我的代码:
UIBezierPath *shapePath = [UIBezierPath bezierPathWithRoundedRect:registerbtn.bounds
byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight
cornerRadii:CGSizeMake(9.0, 9.0)];
CAShapeLayer *shapeLayer = [CAShapeLayer layer];
shapeLayer.frame = registerbtn.bounds;
shapeLayer.path = shapePath.CGPath;
[registerbtn.layer addSublayer:shapeLayer];
输出:
它不工作...相同的输出将显示 –
只是试试这个代码。 https://github.com/joprithiviraj/ButtonCornerRadius –
@bhavin拉马尼,你的回答是正确的,但他只问右侧角半径。所以不想使用UIRectCornerBottomLeft。谢谢.... –