如何使用滚动操作从子视图控制器中获取父视图控制器?
我有两个名为 ViewControllerA 和 ViewControllerB 的 UIViewController。 ViewControllerA 是父类,ViewControllerB 是子类,它是通过 ViewControllerA 类中的 [self.navigationController PushViewController:viewControllerBAnimated:YES];
来查看的。在 ViewControllerB 类中,我隐藏了 NavigationBar。在按钮操作中,我编码为从 ViewControllerB [self.navigationController popViewControllerAnimated:YES];
来 ViewControllerA。现在,我想使用交换操作(滚动到上一个屏幕)而不是使用 UIButton 从 ViewControllerB 转到 ViewControllerA。我该怎么做?有人可以给我任何建议或想法吗?提前致谢。
I have two UIViewController named as ViewControllerA and ViewControllerB
. ViewControllerA is the parent class and ViewControllerB is a child class, it is view by [self.navigationController pushViewController:viewControllerB animated:YES];
from ViewControllerA class. In ViewControllerB class i hidden the NavigationBar. In button action i coded to come ViewControllerA from ViewControllerB [self.navigationController popViewControllerAnimated:YES];
. Now, i want to come ViewControllerA from ViewControllerB using swapping action(Scroll to previous screen) rather than using UIButton. How can i do this? Can anyone please provide me any suggestion or ideas? Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在子控制器中使用它
根据需要使用方向..
快乐编码...
Use this in child controller
Use Direction as you want..
Happy Coding...
您可以尝试在子视图上使用
UISwipeGestureRecognizer
以及执行[self.navigationController popViewControllerAnimated:YES];
的处理程序方法。You can try to use
UISwipeGestureRecognizer
on your child view with handler method that does the[self.navigationController popViewControllerAnimated:YES];
.