0
我正在嘗試爲我的圖像添加兩個不同的邊框圖層。UIImage上的多個CALayer邊框
我已經加入先用下面的代碼:
myImage.layer.borderColor = UIColor.blue.cgColor myImage.layer.borderWidth = 2.0 myImage.roundLayerCorners()
當我做這樣的事情:
let sublayer: CALayer = CALayer() sublayer.backgroundCOlor = UIColor.white.cgColor sublayer.borderWith = 4.0 myImage.layer.addSublayer(sublayer)
它不會顯示在所有。爲什麼,以及如何添加多個邊框?
我希望有一個2像素寬的藍色邊框後面是2個像素寬的白邊
謝謝!
喜那裏 - 它不是從你的問題清楚,但你分配你的子圖框? – Sparky