简体   繁体   English

适用于具有不同主题的应用的iOS启动屏幕?

[英]iOS Launch Screen for app with different themes?

I would like to create a launch screen(s) for my app which gives user an option to choose a theme (black or white). 我想为我的应用程序创建一个启动屏幕,使用户可以选择一个主题(黑色或白色)。

What is the best approach to create a launch screen when I don't know what theme will be used at start-up? 当我不知道启动时将使用哪种主题时,创建启动屏幕的最佳方法是什么?

Any advice will be highly appreciated. 任何建议将不胜感激。

Thanks! 谢谢!

You can not program LaunchScreen.storyboard the alternative way is create a ThemeViewController for example and setup your app's appearance there,then check if user selected a theme skip that view controller to your app main view controller.You can detect if user select a theme using NSUserdefualts . 你不能计划LaunchScreen.storyboard的另一种方式是创建一个ThemeViewController例如和设置您的应用程序的外观出现,然后检查用户所选的主题跳过视图控制器到您的应用程序主视图controller.You可以检测用户使用选择一个主题NSUserdefualts

My suggestion is create a default theme for your app then if users would like to change it they will go to Settings and change the theme. 我的建议是为您的应用程序创建一个默认主题,然后,如果用户想要更改它,他们将转到“设置”并更改主题。

No, it's not possible. 不,不可能。

When launch screen is being displayed your app will be in loading state. 显示启动屏幕时,您的应用程序将处于加载状态。

Even the 即便是

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

will not be completely executed while the launch screen is displayed. 显示启动屏幕时将不会完全执行。

So it's clear that, you don't have any access to your app and so at this point you can't execute any code and so - can't customize LaunchScreen.xib . 很明显,您没有访问您的应用的权限,因此在这一点上您无法执行任何代码,因此-无法自定义LaunchScreen.xib

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM