When i try to build my app to simulator running iPhone X there's an odd spaces on top and bottom of the screen as shown in the image. It's supposed to be full screen. Any idea how i can fix this? Thanks in advance.
i am running rn v0.47 and xcode 9.
In version 0.50. 1, the React Native team introduced a new API for easily dealing with the new iPhone X layout. This API is the SafeAreaView.
The purpose of SafeAreaView is to render content within the safe area boundaries of a device. It is currently only applicable to iOS devices with iOS version 11 or later.
You have to only use when any screen has headerMode:none or it out side of the navigation. If you are using full screen modal then you should use <SafeAreaView> . I don't thing having navigation handles it. For android it might but for iOS with swipe gesture to go to home on bottom, one must use safeareview.
import { SafeAreaView } from 'react-native'; You just use it in place of the top-level View component. It makes sure content within the safe area boundaries is properly rendered around the nested content and applies padding automatically.
Probably you are setting the launch screen as images, try by setting the LaunchScreen
as a storyboard and be sure to have the Use Safe Area Layout Guides
active on it.
If you don't have a LaunchScreen.storyboard
you can just create a new one an set it, or create a new empty project and just grab the existing LaunchScreen.storyboard
and copy/paste it to your current project.
Camo's answer is right. The issue is related on splash screen. But i just wanted to share how i fixed my issue since I am not using storyboard for my launchScreen. So first i created a new launchscreen image with dimensions 1125x2436(portrait) and 2436x1125(landscape) and added it to my launchimage directory. And then updated the Contents.json file adding this 2 configurations:
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"minimum-system-version" : "11.0",
"filename" : "1125x2436.png",
"subtype" : "2436h",
"scale" : "3x"
},
{
"orientation" : "landscape",
"idiom" : "iphone",
"extent" : "full-screen",
"minimum-system-version" : "11.0",
"filename" : "2436x1125.png",
"subtype" : "2436h",
"scale" : "3x"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With