我正在用一排按钮创建一个应用程序。我想设置第一个按钮和最后一个按钮的圆角。第一个按钮与左角和右角的最后一个按钮。我正在使用下面的代码。UIbutton iOS的圆角 - Swift
//Following code from viewDidLoad function
test_1.roundCorners([.TopLeft, .BottomLeft], radius: 20);
test_10.roundCorners([.TopRight, .BottomRight], radius: 20);
extension UIView{
func roundCorners(corners:UIRectCorner, radius: CGFloat) {
let path = UIBezierPath(roundedRect: self.bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
let mask = CAShapeLayer()
mask.path = path.CGPath
self.layer.mask = mask
}
}
我的输出类似下面的截图来自iphone6 plus
我的ipad2屏幕截图
Note:
的Abobe截图这样
请有人帮我找到问题。
编辑:
我需要的输出需要是这样
请留下颜色和交叉符号。
检查我的编辑。这是所需的输出。 – Amsheer