2016-10-22 17 views
0

SwiftでCGContextSetTextDrawingModeで "setLineWidth"プロパティと "setLineJoin"プロパティを使用するにはどうすればよいですか?setLineWidthプロパティ(drawRect関数)でCGContextSetTextDrawingModeを使用

override func drawRect(rect: CGRect) { 

    let context = UIGraphicsGetCurrentContext() 
    CGContextSetTextDrawingMode(context, CGTextDrawingMode.Stroke) 

    context?setLineWidth(2) 
    context.setLineJoin(CGLineJoin.Round) 

} 

プロパティ(setLineWithおよびsetLineJoin)のみが機能しません。 それは1年前に働いた。しかし、今は動作しません。

答えて

0

これはありがとうスウィフト3

let context = UIGraphicsGetCurrentContext() 
    context!.setTextDrawingMode(CGTextDrawingMode.stroke) 

    context?.setLineWidth(2.0) 
    context?.setLineJoin(.round) 
+0

で動作します!私はswiftの最新バージョンに更新しました。今それは働いている! –

+0

あなたは大歓迎です! – Rob

関連する問題