私の iPad アプリケーションでは、画面上に複数のビューがあります。
私がやりたいことは、ナビゲーション バーにダブル タップ ジェスチャ レコグナイザーを適用することです。しかし、私は成功しませんでしたが、そのビューに同じジェスチャ認識エンジンを適用すると機能します。
私が使用しているコードは次のとおりです。
// Create gesture recognizer, notice the selector method
UITapGestureRecognizer *oneFingerTwoTaps =
[[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(oneFingerTwoTaps)] autorelease];
// Set required taps and number of touches
[oneFingerTwoTaps setNumberOfTapsRequired:2];
[oneFingerTwoTaps setNumberOfTouchesRequired:1];
[self.view addGestureRecognizer:oneFingerTwoTaps];
これはビューで機能しますが、これが完了すると:
[self.navigationController.navigationBar addGestureRecognizer:oneFingerTwoTaps]
動作しません。