import { Dimensions, NativeModules, StatusBar, Platform } from 'react-native';
const { StatusBarManager } = NativeModules;
const WINDOW_DIMENSIONS = Dimensions.get('window');
export const WINDOW_WIDTH = WINDOW_DIMENSIONS.width;
export const WINDOW_HEIGHT = WINDOW_DIMENSIONS.height;
export const STATUS_BAR_HEIGHT =
Platform.OS === 'android' ? StatusBar.currentHeight : StatusBarManager.HEIGHT;
react native获取设备屏幕高度、顶部状态栏高度
最新推荐文章于 2024-06-03 21:46:21 发布