简体   繁体   中英

Change storyboard background color of the Launch Screen based on app scheme

I use a view for my splashscreen in React native app on iOS and now we have two schemes and we want to change this view color.

if scheme === App scheme A? "green": "purple" if scheme === App scheme A? "green": "purple" is there a way to make this multiple values like bundle id and product name

It is certainly possible to have different splash screens, resources etc. per app version, and there is a number of ways to achieve that. One that I would recommend looking into is using different build configurations. A working example:

使用不同方案构建应用程序时显示不同启动画面的 gif

Steps:

  1. In Project->Info->Configurations, duplicate existing configurations and give them meaningful names (eg. matching your custom scheme): 第一步,显示构建配置设置

  2. Edit your custom scheme to use the new build configuration (in the 'Run' tab, select the debug version, in the 'Archive' tab, select the release version): 第二步,显示方案编辑选项

  3. Create a new storyboard for your launch screen

  4. In your Target Build Settings, add a new User Defined setting, name it sth like 'LAUNCH_SCREEN_NAME' and set value according to build configuration: 第四步,显示用户定义的构建设置

  5. Finally in your Info.plist, edit or add a 'Launch screen interface file base name' key and set value to the custom build setting from point 4 ( $(LAUNCH_SCREEN_NAME) ) 第五步,在 info plist 中显示启动屏幕键

  6. For React Native, you will also need to add and configure react-native-schemes-manager - I'm assuming you might have already done this since you are using schemes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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