No Description

ScreenDimensions.js 891B

123456789101112131415
  1. /**
  2. * Created by zack on 2017/5/2.
  3. */
  4. import {Dimensions, Platform} from 'react-native'
  5. import ExtraDimensions from 'react-native-extra-dimensions-android'
  6. import NavigationBarHeight from './NavigationBarHeight'
  7. import TabBarHeight from './TabBarHeight'
  8. const ScreenDimensions = {
  9. width: (Platform.OS === 'ios') ? Dimensions.get('window').width : ExtraDimensions.get('REAL_WINDOW_WIDTH'),
  10. height: (Platform.OS === 'ios') ? Dimensions.get('window').height : (ExtraDimensions.get('REAL_WINDOW_HEIGHT') - ExtraDimensions.get('STATUS_BAR_HEIGHT') - ExtraDimensions.get('SOFT_MENU_BAR_HEIGHT')),
  11. clientHeight:((Platform.OS === 'ios') ? Dimensions.get('window').height : (ExtraDimensions.get('REAL_WINDOW_HEIGHT') - ExtraDimensions.get('STATUS_BAR_HEIGHT') - ExtraDimensions.get('SOFT_MENU_BAR_HEIGHT'))) - NavigationBarHeight.height - TabBarHeight.height
  12. }
  13. export default ScreenDimensions