iPhone +以编程方式导航到后屏幕
我正在开发一个应用程序,我需要以编程方式提供向后屏幕的导航,其中有两种情况:
上面有一个 MainWindow.xib 和几个按钮,单击任何一个按钮将加载另一个适当的屏幕。在此屏幕上,我需要放置后退按钮,单击该按钮将再次加载 MainWindow.xib,用户可以选择其他选项。
除了上述场景外,所有屏幕都会包含后退按钮,单击后退按钮将再次加载前一个,用户可以选择其他选项。
除了上述场景外
问候, 普拉蒂克
I am developing a application in which I need to provide navigate to backward screen programmatically, in which there are two scenarios:
There will one MainWindow.xib and few buttons on it, click of any one button will load another appropriate screen. On this screen, I need to put back button, click of which will load MainWindow.xib again and user can choose some other option.
Except the above scenario, also all the screens will contain back button, click of which will load the previous again and user can choose some other option.
Regards,
Pratik
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您想要使用 UINavigationController为了这。请参阅文档和示例项目的链接。我无法在这里给出完整的示例,但您可以从 XCode 中的“基于导航的应用程序”模板开始。
总体思路是,您将视图推送到 UINavigationController 或从 UINavigationController 弹出视图,它将为您处理后退按钮和导航工具栏。这非常简单。
You want to use the UINavigationController for this. See the link for the documentation and example projects. I can't really give a full example here, but you can get started with the "Navigation-Based Application" template in XCode.
The general idea is that you push and pop views to/from a UINavigationController, and it will handle the back button and navigation toolbar for you. It's pretty straight forward.