How to prevent layout from overlapping with iOS status bar

前端 未结 8 2069
礼貌的吻别
礼貌的吻别 2020-12-24 04:45

I am working on tutorial for React Native navigation. I found out that all layout starts loading from top of screen instead of below of the status bar. This causes most layo

相关标签:
8条回答
  • 2020-12-24 05:06

    Just Simple User React native Default StatusBar to achieve this funcationality.

    <View style={styles.container}>
        <StatusBar backgroundColor={Color.TRANSPARENT} translucent={true} />
        <MapView
          provider={PROVIDER_GOOGLE} // remove if not using Google Maps
          style={styles.map}
          region={{
            latitude: 37.78825,
            longitude: -122.4324,
            latitudeDelta: 0.015,
            longitudeDelta: 0.0121,
          }}
        />
      </View>
    
    0 讨论(0)
  • 2020-12-24 05:11

    Here is a way that works for iOS:

    <View style={{height: 20, backgroundColor: 'white', marginTop: -20, zIndex: 2}}>
       <StatusBar barStyle="dark-content"/></View>
    
    0 讨论(0)
提交回复
热议问题