我正在快速设计一个包含左侧菜单的应用程序。 我使用导航 Controller 来识别平移,具体取决于我切换的左侧菜单。
下面是使用导航 Controller 附加平移手势的代码
let panGestureRecognizer = UIPanGestureRecognizer(target: self, action: "handlePanGesture:")
centerNavigationController.view.addGestureRecognizer(panGestureRecognizer)*
在其他 Controller 中,它工作正常,但在有 ScrollView 的 Controller 中,我希望 ScrollView 滚动到内容偏移量 0 并在左侧进一步滚动后,它应该打开左侧菜单。 但它会阻止调用平移手势。
这是矛盾的。
我尝试了很多使用方法的解决方案
func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool {}
但是没有用。
如果需要任何其他信息来定义问题,请告诉我。
提前致谢。
最佳答案
https://github.com/John-Lluch/SWRevealViewController
使用 SwrevealviewController ,你会得到所有这些东西
关于ios - 带有 Pan 手势冲突的 ScrollView 和侧边菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35936824/