多视图 iPhone 应用程序

发布于 2024-09-06 08:36:47 字数 330 浏览 12 评论 0原文

我的 iPhone 应用程序中有几种不同的视图。当应用程序启动时,我将有逻辑来确定从哪个视图开始(而不是总是从相同的视图开始并让用户更改视图)。其中一个“视图”将有多个页面(选项卡或表格行,目前不确定......但主导视图将需要尽可能多的屏幕空间,并且选项卡栏/导航栏始终可见是不可行的理想的或必要的...就像天气和股票应用程序一样,我想要的方法是从实用程序应用程序模板开始,并在“另一面视图”上有一个选项卡栏视图,最好从哪个项目模板开始?我是否必须对模板进行更改?在哪种情况下,我应该放置决策逻辑来确定要显示哪个视图,如果我确实使用实用程序模板,那么在不使用 TabBar 模板的情况下将翻转面设置为选项卡栏视图是否很棘手?从一开始就先谢谢了。

I have several different views in my iPhone app. When the app starts, I will have logic to determine which view to start with (rather than always starting with the same view and leaving it up to the user to change views). One of the "views" will have several pages (tabs or table rows, not sure at this point... but the dominant view will need as much screen real estate as possible and having a tab bar/navigation bar always visible isn't desirable or necessary ... It would be like the Weather and Stocks apps. My desired approach would be to start with the Utility app template and have a tab bar view on the "flipside view". Which project template is best to start with? Do I have to make changes to the template? In which event should I put the decision logic to determine which view to show. If I do indeed use the Utility template, is it tricky to make the flipside a tabbar view without using the TabBar template from the beginning? thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

强辩 2024-09-13 08:36:47

您可以从基于视图的应用程序模板开始,让您的视图更改按钮回调到您的应用程序委托来更改您的视图,如下所示

-(IBAction)goToSomeOtherView {
yourAppDelegate appDelegate = (YourAppDelegate) [[UIApplication sharedApplication] delegate];
[appDelegate viewChangingCode];

在应用程序委托中,只需清除当前视图并添加新视图即可 这样您就可以在视图更改之间获得您想要的任何动画。

添加标签栏也非常简单。您可以在界面生成器中完成此操作并根据需要链接按钮。

You could start with the view based application template and have your view changing buttons call back to your app delegate to change the views for you like this

-(IBAction)goToSomeOtherView {
yourAppDelegate appDelegate = (YourAppDelegate) [[UIApplication sharedApplication] delegate];
[appDelegate viewChangingCode];
}

And in the app delegate, just clear out the current view and add the new view. That way you could have whatever animation you wanted in-between view changes.

Adding a tab bar is pretty straight forward as well. You can do it in interface builder and link up the buttons as needed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文