0
私は、pageEnabled UIScrollViewを使用して、異なるページを持つ図書ブックアプリケーションを作成しようとしています。目的C:UIScrollViewでタッチを描く
私は何を使うつもりですか?タッチイベントは機能しません。
私はタッチで前にこのコードを持っているが移動:
touchSwiped = YES;
UITouch *touch = [touches anyObject];
CGPoint currentPoint = [touch locationInView:self.view];
currentPoint.y -= 20;
UIGraphicsBeginImageContext(self.view.frame.size);
[drawView.image drawInRect:CGRectMake(0, 0, drawView.frame.size.width, drawView.frame.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 15.0);
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 0, 0, 0, 1.0);
CGContextBeginPath(UIGraphicsGetCurrentContext());
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
drawView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
lastPoint = currentPoint;
touchMoved++;
if (touchMoved == 10) {
touchMoved = 0;
}
を私はこれを実装するために何をする必要があるか調整任意のアイデアを持っていません。
誰でも??
ありがとうございます。
を描く行うには、実際のコードのためにこのウェブサイトをチェックし、どのようにスクロールビューを知っていますか? – Roberto
私はUIPanGestureを使って試しました – SeongHo
「タッチイベントは機能していません」と言うと、正確にはどういう意味ですか?描画するのではなくスクロールしますか?またはタッチが全くキャプチャされていませんか?スクロールするには、コンテンツサイズがフレームサイズよりも大きくなければならないことに注意してください。 – Roberto