如何将启动屏幕或初始视图添加到 Xcode iPhone 实用程序模板

发布于 2024-08-22 05:21:16 字数 154 浏览 6 评论 0原文

  1. 我已经使用实用程序模板制作了一个应用程序。
  2. 我想在应用程序启动时再添加一个视图(如启动屏幕)。
  3. 在此视图中,我有三个按钮。当我按下三个按钮之一时,将加载实用程序模板的主视图。

如果可能的话请帮助我发送代码..提前致谢

  1. I have made an application using the utility template.
  2. I want to add one more view when the application launches (like a splash screen.)
  3. In this view, I have three buttons. When I press one of the three buttons, the main view of the utility templete will be load.

Please help me if possible send code..thanks in advance

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

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

发布评论

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

评论(2

眼波传意 2024-08-29 05:21:16

初始屏幕和初始视图是两个完全独立的结构。

启动画面是一个没有活动 UI 的简单图像。您可以通过将名为“default.png”的图像文件放入资源中来创建启动屏幕。该应用程序将在启动时在加载任何视图之前自动显示该内容。苹果人机界面指南指出,尽可能避免使用闪屏。它们的正确用法是通过呈现 UI 图像来制造应用程序启动速度更快的错觉,以便用户可以开始自我定位。当用户阅读界面并触摸屏幕时,真正的 UI 应该处于活动状态。

您想要一个初始视图,而不是真正的启动屏幕。您实际上并不需要使用实用程序模板。该模板配置为显示最简单的两个视图应用程序,您应该选择基于导航的项目。

您可以通过将初始视图添加为实用程序项目中导航控制器的根控制器来修改现有项目。导航控制器上的 Apple 文档有示例代码来向您展示如何执行此操作。

A splash screen and an initial view are two entirely separate constructs.

A splash screen is a simple image with no active UI. You create a splash screen by putting an image file named "default.png" into the resources. The app will automatically display that at startup before any views load. The Apple Human Interface Guidelines say to avoid the use of splash screens whenever possible. Their proper use is to create the illusion that the app has started more quickly than it has by presenting an image of the UI so the user can can begin to orient themselves. By the time the user reads the interface and goes to touch the screen, the real UI should be active.

You want an initial view, not a true splash screen. You don't really need to be using the utility template. That template is configured to show the simplest two view app possible anything more and you should select the navigation based project.

You can modify your existing project by adding you initial view as the rootcontroller of the navigation controller in the utilities project. The Apple documents on the navigation controller have sample code to show you how to do this.

寄意 2024-08-29 05:21:16

我现在正在研究类似的东西,不同的是我没有使用“Default.png”,而是使用图像动画。问题是我看不到找到正确的 void 方法来使我的动画在应用程序加载时加载,而不是每次我返回主视图控制器时。然而,你的问题有一个我之前忽略的简单答案,而不是在主视图加载之前制作启动屏幕,而是将主视图放入“启动屏幕”并将其设置为链接到其他子视图。

- (IBAction)pageOne {  
    ExampleViewController *ProView =
    [[ExampleViewController alloc]
    initWithNibName:@"ExampleViewController"
    bundle:nil];

    ExampleView.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

    [self presentModalViewController:ProView animated:YES];
}

沿着这些思路,我也尝试分享所有这一切的屏幕截图,但我想我的信誉不够好,无法这样做。

I'm working on something kind of similar right now, the difference is I'm not using "Default.png", but an animation of images instead. The problem is I can't see to find quite the right void method to make my animation load when the application loads, not every time i return to the mainviewcontroller. However your problem has a simple answer that I have overlooked before, rather than make a splash screen before your main view loads, make your mainview into your "splash screen" and set it to link to other subviews.

- (IBAction)pageOne {  
    ExampleViewController *ProView =
    [[ExampleViewController alloc]
    initWithNibName:@"ExampleViewController"
    bundle:nil];

    ExampleView.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

    [self presentModalViewController:ProView animated:YES];
}

Something along those lines, I tried to share a screenshot of all this as well but I guess I'm not reputable enough to do so.

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