[英]How to show random view controller on button click iOS
I have an app having 7 screen and 3 tabs. 我有一个具有7个屏幕和3个标签的应用程序。 on the screen 7 i have a button that submits data but after submitting data , the UI still shows screen 7 I want to show my screen 1 (of tab 1)so that user can restart next operation, screen 1 has nav bar , table view control and few other buttons.
在屏幕7上,我有一个提交数据的按钮,但是在提交数据后,UI仍显示屏幕7。我想显示我的屏幕1(选项卡1的屏幕),以便用户可以重新开始下一个操作,屏幕1具有导航栏,表格视图控制和其他几个按钮。
I know in submit action of the button i have to do some calling , but no idea exactly what to do.. 我知道在按钮的提交动作中我必须进行一些调用,但不知道该怎么做。
Pls suggest/help. 请提出建议/帮助。 Thanks in adv.
感谢在广告中。
Try: 尝试:
NSArray *mycontrollers = self.tabBarController.viewControllers;
NSLog(@"%@",mycontrollers);
UINavigationController *nvc = [mycontrollers objectAtIndex:0];
UIViewController *vc = [nvc topViewController];
[self.navigationController popToViewController:vc animated:YES];
Control-drag form your button to you new viewcontroller and select Modal. 按住Control键将按钮拖到新的ViewController中,然后选择Modal。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.