// 在需要禁用右滑pop手势的ViewController中加入以下代码
id target = self.navigationController.interactivePopGestureRecognizer.delegate;
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:target action:nil];
[self.view addGestureRecognizer:pan];iOS开发笔记之在某个ViewController中禁用右滑pop手势
最新推荐文章于 2022-04-19 15:45:59 发布
本文介绍了一种在iOS应用中禁用特定ViewController右滑返回手势的方法。通过为导航控制器的交互式弹出手势识别器分配委托并创建一个新的平移手势识别器,可以有效地阻止用户通过右滑操作来关闭当前视图。
1083

被折叠的 条评论
为什么被折叠?



