App flashing white after launch screen on iOS 11?

前端 未结 2 848
-上瘾入骨i
-上瘾入骨i 2021-01-06 23:22

Since I updated my phone to iOS 11 I have noticed that my React Native app briefly (<0.5s) flashes to white between the launch screen and the first screen of the app. Thi

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-06 23:49

    Ok, I think I found the issue. In AppDelegate.m, the rootView has a white background color as default, and when I start the app it transitions from: Launch screen -> rootView -> React Native view.

    On iOS 10 I never saw the rootView flash by, but on iOS 11 there seems to be a short delay before the RN view is loaded. I'm not sure why this happens on iOS 11 and not 10, but you can solve this by either:

    1. Set a background color on rootView to match the launch screen.
    2. Set the launch screen as background of rootView. Here is a guide: https://peterminarik.tumblr.com/post/153039209421/how-to-fix-the-initial-white-flash-in-your-react

提交回复
热议问题