0
これは本当に簡単ですが、私が間違っていることを理解できません。iOS - ビューコントローラでドーナツを描く
私は中央に1つのビューを持つビューコントローラを持っています。私は以下のサークルのようなものを描きたい:
私がいる主な問題は、私は、ビューに表示するanytihng得ることができないです。私はちょうど今、ラインを描こうとしているが、明らかに何かキーがない。私のコードは以下の通りです:
@interface ViewController()
@property (weak, nonatomic) IBOutlet UIView *centerView;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
[[UIColor brownColor] set];
CGContextRef currentContext =UIGraphicsGetCurrentContext();
CGContextSetLineWidth(currentContext,5.0f);
CGContextMoveToPoint(currentContext,50.0f, 10.0f);
CGContextAddLineToPoint(currentContext,100.0f, 200.0f);
CGContextStrokePath(currentContext);
}
ここには多くの基本がありません。 [iOS用の描画と印刷ガイド]から始めてください(https://developer.apple.com/library/prerelease/content/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40010156)。 )、 多分? – rickster
で始めるか、https://github.com/kirualex/KAProgressLabelで始めることができます –
私はdrawRectのUIBezierPathが好きです: – Alex