2016-09-07 8 views
0

私はユーザーがキャンバスに指の署名を描くことを可能にするアプリケーションを開発しました。 この機能は、UIPanGestureRecognizerを使用して特定のターゲットアクションを使用してUIViewに線を描画して実装されますが、「ボイスオーバー」がアクティブなときにジェスチャ認識器の動作はそれ以上トリガされません。ボイスオーバーを有効にしたジェスチャー認識器

ジェスチャーは、アクティブな「ボイス・オーバ」とジェスチャーを使用してビューに線を描画するためにどのような方法があり、コード

UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)]; 
pan.maximumNumberOfTouches = pan.minimumNumberOfTouches = 1; 
[self addGestureRecognizer:pan]; 

ジェスチャーアクションコード

- (void)pan:(UIPanGestureRecognizer *)pan { 
    CGPoint currentPoint = [pan locationInView:self]; 
    CGPoint midPoint = midpoint(previousPoint, currentPoint); 

    if (pan.state == UIGestureRecognizerStateBegan) 
    { 
     [path moveToPoint:currentPoint]; 
    } 
    else if (pan.state == UIGestureRecognizerStateChanged) 
    { 
     [path addQuadCurveToPoint:midPoint controlPoint:previousPoint]; 
    } 

    previousPoint = currentPoint; 

    [self setNeedsDisplay]; 
} 

を初期化?

ありがとうございました!

+0

http://stackoverflow.com/questions/33709260/swipe-gesture-recogniser-using-voiceoverで答えをチェック – spassas

答えて

0

私はUIViewのキャンバスの両方isAccessibilityElementとaccessibilityTraitsプロパティを設定する私の問題を解決:

canvasView.isAccessibilityElement = YES; 
canvasView.accessibilityTraits = UIAccessibilityTraitAllowsDirectInteraction; 
関連する問題