2011-06-09 23 views
0

我在我的項目中使用了openflow庫。需要當我點擊openflow中顯示的圖像時,另一個視圖控制器將被打開。TapGesture在openflowview上識別ony

我的問題是我做了一個tapGestureRecognizer,但它會在該視圖和其他所有按鈕中調用。 我希望tapGestureRecognizer在打開流程上點擊圖像時啓動,不需要其他位置。 請幫我,我在這裏卡住了。 在此先感謝!

回答

1

只需將輕擊手勢添加到您想要的視圖。

UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGesture:)]; 

//openFlowImageView is the view that you want the tap to work on. 
[openFlowImageView addGestureRecognizer:tap]; 
[tap release]; 
+0

沒有鑑於openflowview.m – Gypsa 2011-06-10 04:27:19

+0

以及名爲openFlowImageView無論您的圖像視圖的名稱,替換「openFlowImageView」的程度。 – Louie 2011-06-10 04:45:51