我正在用一排按鈕創建一個應用程序。我想設置第一個按鈕和最後一個按鈕的圓角。第一個按鈕與左角和右角的最後一個按鈕。我正在使用下面的代碼。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