关于iPhone应用程序开发中的多个视图的问题
是否可以创建一个可以处理 5 个视图的视图控制器? 是否可以在每个视图上实现不同的按钮以转换到根视图?
所以我对应用程序的想法是,当我加载它时,它会将我带到主窗口,在该窗口上将有 5 个按钮,将带我进入 5 个视图,在我进入该视图后,除其他按钮外,还会有只是一个按钮,只能将我带到主视图。
假设这 5 个视图中有一些是选项、分数、统计等。
如果可以使用如此多的视图制作这样的应用程序,这是一个好方法吗?
Is it possible to create a viewcontroller that could handle 5 views?
And is it possible to implement a different button on every view to make a transition to root view?
So my idea of the app is when I load it it takes me to main window, and on that window there will be 5 button that will take me to the 5 views, and after I'm in that view, among other buttons there will be just one button that will take me only to the MainView.
Let's say that some of those 5 views will be Options, Score, Statistics, something like that.
If it is possible to make an app like that using so much views, is it a good approach?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是可能的,但从你的描述来看,这听起来不是一个好主意。我建议改为制作一个选项卡栏应用程序,并为 5 个视图中的每一个视图都有一个单独的视图控制器。
如果您不想制作选项卡栏应用程序,您当然可以执行您所描述的操作,但我建议为每个视图都有一个单独的视图控制器实例。您可以在主视图中放置 5 个按钮,每个按钮都可以推送一个没有动画的模式视图。然后您可以添加任何您想要的过渡动画。在模态视图中,您可以有一个弹出模态视图的按钮。
在你的主视图控制器中,你可以这样做:
在你的视图 1 控制器中:
This would be possible, but from what you describe, it does not sound like a good idea. I would suggest instead making a Tab Bar app, and having a separate view controller for each of your 5 views.
If you do not want to make a tab bar app, you can certainly do what you describe, but I would recommend having a separate view controller instance for each view. You could have your 5 buttons in your main view, and each button could push a modal view with no animation. You could then add whatever transition animation you want. In your modal view, you could have a button that pops the modal view.
In your main view controller, you would do this:
And in your view 1 controller: