iOS Launch screen in React Native

后端 未结 13 878
时光取名叫无心
时光取名叫无心 2020-12-04 05:44

I\'m working with a React Native app and I\'m trying to set a customize launch screen but I\'m not able to.

React Native creates a LaunchScreen.xib by default, so I\

相关标签:
13条回答
  • 2020-12-04 06:28

    Follow this link:

    If you want to add a splash screen to my React Native application.Follow the process, the result will be all yours.

    STEP:1 First,I created a splashImageResource folder and added the launchScreen.xib file with the splash image.

    STEP:2 change the code as written inside the subviews tag. with this code<subviews> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" image="splash.png" translatesAutoresizingMaskIntoConstraints="NO" id="ZkI-RL-69Z"> </imageView> </subviews>

    STEP:3 You should open your app in Xcode. Here are the steps to follow:

    a) Go to your project folder

    b) Open the ios folder

    c) Go to the file that has .xcodeproj as the extension, in my case it's splasScreenTutorial.xcodeproj

    d) Open this file in your Xcode.

    e) Delete the launchScreen.xib file.

    f) Click on the splashScreenTutorial folder, then go to the TARGETS section

    g) Click on the General Tab on the top-left corner of your Xcode and scroll down to App Icons and Launch Images

    h) Go to Launch Images Source and click Use Asset Catalog. Click on migrate.

    i) Remove the text LaunchScreen from Launch Screen File.

    j) Go back to your project folder and open the Images.xcassets file. You should see AppIcon and LaunchImage.

    k) Next, click on the LaunchImage, Finally, drag the splash screen images that you have of different sizes to the Launch Image box.

    Drag the images like this.

    Test Splash Screen a) To see the changes, you need to delete the app from your simulator if you have run the app initially.

    b) To delete the app, click on the Hardware menu on your Simulator bar and go to Home.

    c) Tap and hold down the particular app icon you want to delete, and click on the X sign on the icon.

    d) Run your app again using react-native run-ios

    You can see your Splash Screen

    0 讨论(0)
提交回复
热议问题