ViewController 通过切换屏幕转到上一个 ViewController
ViewController going to previous ViewController by swapping on the screen
假设我有两个 viewController、AViewController
和 BViewController
。 AViewController
嵌入在 NavigationController
中(来自菜单 "Editor > Embedded In > NavigationController")。从 AViewController
中的 按钮操作 将用户推送到 BViewController
(使用 segue)。现在用户可以通过在 BViewController
.
中按 backButton
返回到 AViewController
但奇怪的是,在 BViewController
中,如果我从左到右交换屏幕,看起来就像是从堆栈中移除视图并显示 AViewController
。我不想要这种交换。我只想使用后退按钮转到上一个 viewController,在这种情况下为 BViewController
。我怎样才能停止这种交换?
提前致谢。
PS : 我在整个项目中没有添加任何类型的手势
在 AViewController
中添加下面的行 ViewDidLoad
以禁用导航控制器的交互式弹出。那么一切都应该如你所愿。
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
假设我有两个 viewController、AViewController
和 BViewController
。 AViewController
嵌入在 NavigationController
中(来自菜单 "Editor > Embedded In > NavigationController")。从 AViewController
中的 按钮操作 将用户推送到 BViewController
(使用 segue)。现在用户可以通过在 BViewController
.
backButton
返回到 AViewController
但奇怪的是,在 BViewController
中,如果我从左到右交换屏幕,看起来就像是从堆栈中移除视图并显示 AViewController
。我不想要这种交换。我只想使用后退按钮转到上一个 viewController,在这种情况下为 BViewController
。我怎样才能停止这种交换?
提前致谢。
PS : 我在整个项目中没有添加任何类型的手势
在 AViewController
中添加下面的行 ViewDidLoad
以禁用导航控制器的交互式弹出。那么一切都应该如你所愿。
self.navigationController.interactivePopGestureRecognizer.enabled = NO;