沒有響應我目前面臨的,我在一個視圖&我想右輕掃手勢當用戶刷卡從索引值0
右側工作使用UIPageViewController
的場景,所以我想通過下面的代碼到右輕掃手勢添加到UIPageViewController
:的iOS:右輕掃手勢在UIPageViewController
UISwipeGestureRecognizer *rightRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(rightSwipeHandle:)];
rightRecognizer.direction = UISwipeGestureRecognizerDirectionRight;
[rightRecognizer setNumberOfTouchesRequired:1];
//Edit 1
[self.pageViewController.view addGestureRecognizer:rightRecognizer];
,但是,當我加入的手勢pageviewcontroller
我收到以下錯誤信息(通過@Lyndsey斯科特回答解決)
no visible interface uipageviewcontroller declares the selector addgesturerecognizer
任何人都可以指導我,我怎麼能實現本pageViewController
編輯1右輕掃:取代@Lyndsey斯科特提供的代碼,去掉了錯誤,但問題仍然存在,我不能觸發該滑動事件。
這已經消除了我的錯誤,但選擇器沒有被正確的刷卡調用。有什麼建議麼? – iYoung
@RajatDeepSingh的問題是,它被封鎖的默認識別器,你大概手勢同時承認,但如果你想在網頁刷卡*和*在同一時間被識別的姿態,加入刷卡手勢是不必要的,因爲你可以簡單地觸發你的方法翻頁... –
@RajatDeepSingh - 認爲你的問題已被回答。你在問另一個問題。請接受答案併發布新問題。 –