ボタンの丸い四角形のボタンを設定しようとしました。しかし彼らは底の右だけを適用する。UIButtonの左下、右下のみRoundRectagleのcornerRadiusを設定する方法は?
ボタンの両側に丸みのある矩形があります。 は、これは私のコードです:
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 Ramani、あなたの答えは正しいですが、彼は右角の半径だけを聞いています。だから、UIRectCornerBottomLeftを使いたくありません。ありがとう.... –