- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我一直在寻找这个问题的解决方案,但没有找到。所以我在我的项目中使用 SWRevealViewController 作为侧边栏菜单,但我希望当用户开始从 View 的左边缘触摸时,侧边菜单会打开。我想要这个,因为我有另一个用于左右滑动的 swipeGestureRecognizer。要添加左右滑动,我使用以下代码:
UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipedToRight:)];
swipeRight.direction = UISwipeGestureRecognizerDirectionRight;
UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget: self action: @selector(swipedToLeft:)];
swipeLeft.direction = UISwipeGestureRecognizerDirectionLeft;
所以我的问题是如何让侧边菜单只有在触摸从左边缘开始时才会打开?
UPD 1
我使用这段代码通过在屏幕的任何部分平移来打开侧边菜单
[self.view addGestureRecognizer: self.revealViewController.panGestureRecognizer];
而且我有识别器可以向右滑动。问题是一旦打开菜单并执行滑动操作。我只想在触摸来自左边缘时才允许打开菜单
已解决 UPD 2
我通过设置可拖动边框宽度解决了这个问题:
self.revealViewController.draggableBorderWidth = self.view.frame.size.width / 2;
现在从边缘到中心的手势打开菜单,从中心到右边界执行滑动的 Action
最佳答案
我要做的是修改 UINavigationController 类中内置的已经存在的弹出手势。
关于ios - SWRevealViewController panGestureRecognizer 和 UIScreenEdgeGestureRecognizer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31833577/
我正在使用良好的控制SWRevealViewController,但通过一些重做,我想在屏幕上跟踪我自己的滑动手势。那么如何关闭滑动选项呢?我只想使用附加到我的按钮的 revealToggle 方法。
我正在开发应用程序,注册过程后主屏幕将出现。并且 SWRevealViewController 已在主屏幕中配置。 我想以编程方式配置 SWRevealViewController。 下面是我的代码
所以我正在使用SWrevealViewController。它运行良好,但我遇到一个问题,当绘制或切换后 View 时,它将前 View 推到右侧,它不会滑过前查看。 如何让它滑过前 View ? 最
我用了SWRevealViewController为我的 iOS 应用程序创建一个滑出菜单。现在我想定制它。我一直在尝试使用本教程作为引用http://www.ebc.cat/2015/03/07/c
在遵循 AppCoda 的 tutorial 之后,我正在使用 SWRevealViewController .我能够在教程中毫无问题地使用它,但无法使其适应我自己的应用程序。原因是在我的应用程序中,
我有一个实现 SWRevealViewController 的应用程序,但我遇到了一些问题。 我有两个问题,我猜它们可能彼此相关(我不确定,因为我对此很陌生)。 如果我在一个从 SWRevealCon
我正在制作简单的 iOS 应用程序,其中有侧边菜单(使用 swrevealviewcontroller)和带有 3 个选项卡的选项卡栏。当我点击特定菜单项时,我想要我的标签栏更改标签。但是sideme
如何在 SWRevealViewController 中给原来的 View controller 添加返回按钮? 我检查了这些并尝试了它们都不起作用: Slide Out Menu without a
我在我的 swift 项目中包含了 SWRevealViewController objective-c 库, 工作正常, 我的问题是,当用户单击其 TableView 中的空白区域时,我想以编程方式
我正在使用 SWRevealViewController 在我的 IOS 应用程序中实现侧边栏。我已经按照 appcoda 教程来实现它,我需要将侧边栏重新定位到 tableview 行中的原始位置点
我正在使用 SWRevealViewController 在我的 iOS 应用程序中添加侧边栏菜单。我的前后 View Controller 都是表格 View Controller 。我的前 Vie
当我显示一个对象时,我想将它传递到我的后端 UIViewController。我在界面生成器中设置了 SWRevealViewController。我尝试在 prepareForSegue 中将其传递
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_AppDelegate", referenced from: objc-class-
我是 iOS 的新手,遇到了一个问题,我已经成功地实现了 SWRevealViewController 侧边菜单,如果我把 View Controller 作为初始屏幕,它就可以工作,但是当它在登录过
我正在使用 John-Lluch 的 SWRevealViewController。我需要使用平移手势来查看侧边栏,并且我正在使用滑动来查看我的上一篇和下一篇文章。但是,只能检测到平移手势。 更新:如
我使用 SWRevealViewController 在我的应用程序中添加侧边栏菜单。我有我的 SideBarViewController,我在其中设置 View Controller ,比方说 Op
通过 SWRevealViewController 将参数从一个 ViewController 传递到另一个 ViewController。这不是在Front Controller和Rear Cont
我在我的应用程序中使用 SWRevealViewController 作为左滑动菜单。我想检测菜单何时显示在我的 ViewController 中。我怎样才能做到这一点? 最佳答案 检测何时加载 Vi
我正在使用 SWRevealViewController 在 Swift 2.0 中显示侧边菜单 我已经从 GitHub 下载了文件,创建了桥接头并正确连接了转场。我正在创建一个自定义按钮,但“显示切
我正在使用 SWRevealViewController 库在我的应用中用作左滑菜单; github 链接:SWRevealViewController 我已经下载了以下项目示例 Appcoda pr
我是一名优秀的程序员,十分优秀!