NativeBase + Exponent Header

后端 未结 5 1134
情话喂你
情话喂你 2021-02-07 08:44

I\'m using NativeBase with Exponent. The Header goes beneath the phone\'s StatusBar. You can see this in the NativeBase demo that Exponent released.

Does anyone

5条回答
  •  猫巷女王i
    2021-02-07 09:09

    Since this issue only comes up in Android, the recommended way to fix this would be to target Android specifically using Platform :

    import {Platform, StatusBar} from 'react-native'
    
    const styles = StyleSheet.create({
        container: {
                flex: 1,
                ...Platform.select({
                    android: {
                        marginTop: StatusBar.currentHeight
                    }
                })
    
            }
    })
    

    Where container is the main container in the app.

    
     // rest of the code here
    
    

提交回复
热议问题