Ei kuvausta

DimensionsTools.js 797B

12345678910111213141516171819202122232425
  1. /**
  2. * Created by zack on 2018/5/2.
  3. */
  4. import {Platform, Dimensions} from 'react-native'
  5. import ExtraDimensions from 'react-native-extra-dimensions-android'
  6. const NavigationBarHeight = {
  7. height: Platform.OS === 'ios' ? (Dimensions.get('window').height < 812 ? 64 : 86) : 56 ////refer to google Android MD style.
  8. }
  9. const TabBarHeight = {
  10. height: Platform.OS === 'android' ? 56 : 49
  11. }
  12. const ScreenDimensions = {
  13. width: (Platform.OS === 'ios') ? Dimensions.get('window').width : ExtraDimensions.get('REAL_WINDOW_WIDTH'),
  14. height: (Platform.OS === 'ios') ? Dimensions.get('window').height : (ExtraDimensions.get('REAL_WINDOW_HEIGHT') - ExtraDimensions.get('STATUS_BAR_HEIGHT') - ExtraDimensions.get('SOFT_MENU_BAR_HEIGHT'))
  15. }
  16. export {
  17. NavigationBarHeight,
  18. TabBarHeight,
  19. ScreenDimensions
  20. }