UIWindowの上にUIimageviewを使用しています。そのImageviewのタッチイベントを処理したいのですが、できません。
UIviewでUIimageViewを使用する場合、touchBegan、touchEndedを使用できますが、UIViewではなくUIWindowにある場合の処理方法。
ありがとう..
UIWindowの上にUIimageviewを使用しています。そのImageviewのタッチイベントを処理したいのですが、できません。
UIviewでUIimageViewを使用する場合、touchBegan、touchEndedを使用できますが、UIViewではなくUIWindowにある場合の処理方法。
ありがとう..
タップを処理するだけの場合は、設定する必要があります。
imageView.userInteractionEnabled = YES;
デフォルトでは、UIImageView のuserInteractionEnabledプロパティはNOに設定されています。それにタップジェスチャレコグナイザを追加できます
UITapGestureRecognizer *tgr = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(anyMethod)];
[imageView addGestureRecognizer:tgr];
[tgr release];
画像を移動したい場合は、UIPanGestureRecognizerを使用できます。
- (void)sendEvent:(UIEvent *)event
try this function