現在、スクロールビューでタッチして描画できるようにするプロジェクトに取り組んでいます。唯一の問題は、スクロールビューの下部に描画できないことです。と何か関係があると考えていますUIGraphicsgetCurrentContext()
。どんな助けも素晴らしいでしょう!ここに私がこれまでに持っているものがあります
- (void)drawRect:(CGRect)rect {
//Here
UIGraphicsBeginImageContextWithOptions(CGSizeMake(1630, 2400), YES, 5);
__block CGContextRef context = UIGraphicsGetCurrentContext();
//CGContextAddRect(context, CGRectMake(0, 0, 1024, 1620));
//[contentView.layer renderInContext:context];
CGContextSaveGState(context);
CGContextSetStrokeColorWithColor(context, [[UIColor blackColor] CGColor]);
CGContextSetLineWidth(context, 4.0f);
CGContextSetLineCap(context, kCGLineCapRound);
CGContextSetLineJoin(context, kCGLineJoinRound);
[[ProblemStore sharedProblemStore] mapCurrentSolutionStrokes:^(SolutionStroke *stroke, NSUInteger strokeNum) {
[self drawStroke:stroke inContext:context];
}];
CGContextRestoreGState(context);
UIGraphicsEndImageContext();
}