How to find height of status bar in Android through React Native?

前端 未结 4 1719
刺人心
刺人心 2021-01-30 20:31

How can I find the height of the status bar on Android through React Native?

If I check the React.Dimensions height the value seems to include the status ba

4条回答
  •  青春惊慌失措
    2021-01-30 20:56

    import Constants and Dimensions.

    import Constants from 'expo-constants';
    import Dimensions  from 'react-native';
    

    in stylesheet container hight - status bar hight = without status hight.

     container: {   height: Dimensions.get('window').height - Constants.statusBarHeight,}
    

提交回复
热议问题