0
Q
Ios5轻扫手势
A
回答
4
使用滑动手势了右方向(下一个按钮)和左方向(后退键) 左方向:
UISwipeGestureRecognizer *swipeLeft =[[UISwipeGestureRecognizer alloc]
initWithTarget:self action:@selector(didSwipeLeft:)];
swipeLeft.direction=UISwipeGestureRecognizerDirectionLeft;
swipeLeft.numberOfTouchesRequired = 1;
[self.view addGestureRecognizer:swipeLeft];
[swipeLeft release];
对于正确的方向:
UISwipeGestureRecognizer *swipeRight =[[UISwipeGestureRecognizer alloc]
initWithTarget:self action:@selector(didSwipeRight:)];
swipeRight .direction=UISwipeGestureRecognizerDirectionRight;
swipeRight .numberOfTouchesRequired = 1;
[self.view addGestureRecognizer:swipeRight ];
[swipeRight release];
你用事件处理它们:
-(void)didSwipeRight
{
//For right direction (next button)
}
-(void)didSwipeLeft
{
//For left direction (back button)
}
相关问题
- 1. 轻扫手势iphone
- 2. 平移手势 - 轻扫手势冲突
- 3. UIView +轻扫手势info
- 4. IOS:承认轻扫手势
- 5. 检测轻扫手势
- 6. iOS5轻扫手势切换图像 - 请求帮助
- 7. 如何检测轻扫/轻拂手势?
- 8. 两根手指轻扫手势
- 9. Swift - 右侧自定义轻扫手势
- 10. 离子轻扫手势不被识别
- 11. 轻扫手势和uisegmented控件
- 12. 检测轻扫手势的UIWebView
- 13. UIView轻扫手势更改图像
- 14. 启用禁用轻扫手势swift
- 15. iOS:在子视图内轻扫手势
- 16. 导航轻扫手势问题
- 17. 如何通过轻扫手势
- 18. 的iOS:右轻扫手势在UIPageViewController
- 19. iOS 3.2中的UISwipeGestureRecognizer轻扫手势
- 20. 轻扫手势和Wordpress模板
- 21. AS3画廊模仿iphone轻扫手势?
- 22. Android像轻扫手势解锁
- 23. UIscrollView轻扫手势+ iOS上的UIButton手指压下效果
- 24. 离子轻扫手势不适用于手机
- 25. 如何为UIPageViewController启用Voice Over 3手指轻扫手势
- 26. iOS5上的UIGestureRecognizerDelegate和手势
- 27. iOS - 忽略轻击手势
- 28. CKComponent处理轻击手势
- 29. 在引擎中水平和垂直检测轻扫手势
- 30. HTML5 iOS应用程序轻扫手势并获取数据
谢谢你的代码。请您详细说明您的答案,并告诉我如何将其与“页面控制”集成?如果我需要连接它与故事板。我已upvoted你的答案:) – user1949873