こんばんは
タイトル通り、Arcを描こうとしているのですが、何も表示されないのです。
間違っているところを教えてください。よろしくお願いいたします
swift
1import UIKit 2 3@IBDesignable 4 5class DrawArcTest: UIView { 6 override func drawRect(rect: CGRect) { 7 let center = CGPoint(x: bounds.width/2, y:bounds.height/2) 8 let radius: CGFloat = max(bounds.width, bounds.height) 9 let arcWidth: CGFloat = 20 10 let startAngle: CGFloat = CGFloat(M_PI*3/4) 11 let endAngle: CGFloat = CGFloat(M_PI/4) 12 let arc = UIBezierPath(arcCenter: center, radius: radius, startAngle: startAngle, endAngle: endAngle, clockwise: true) 13 arc.lineWidth = arcWidth 14 UIColor.blueColor().setStroke() 15 arc.stroke() 16 } 17}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/05/03 13:49