-4
有人可以建議我用iOS中的顏色填充自定義數量的圓圈嗎?如何在iOS中用自定義數量填充顏色來繪製圓圈?
有人可以建議我用iOS中的顏色填充自定義數量的圓圈嗎?如何在iOS中用自定義數量填充顏色來繪製圓圈?
進口的UIKit
@IBDesignable class YourNewClass: UIButton {
@IBInspectable var fillColor:UIColor = UIColor.greenColor()
@IBInspectable var isAddButton:Bool = true
override func drawRect(rect: CGRect) {
var path = UIBezierPath(ovalInRect: rect)
fillColor.setFill()
path.fill()
} }
我在學習本教程的同時瞭解到這一點http://www.raywenderlich.com/90690/modern-core-graphics-with-swift-part-1
ps.s.一旦你畫了一個圓形按鈕,你總是可以在屬性檢查器中選擇顏色。
你是什麼意思。請分享預期輸出的截圖。 –
詢問前請先搜索。 [Here's](http://stackoverflow.com/questions/3729690/draw-part-of-a-circle)從搜索中擊中。 – trojanfoe
你可以看看這個https://github.com/Marxon13/M13ProgressSuite –