Dimensions (英译:尺寸)
获取当前屏幕的宽高:
// 引用
let { height, width } = Dimensions.get('window');
// 使用
coverBg: {
width: '100%',
height: height,
zIndex: 998,
position: 'absolute',
backgroundColor: 'rgba(0,0,0,0.3)',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
}
ps:
- rn获取屏幕宽度和高度信息的另一种方法
https://blog.csdn.net/meng1128/article/details/71023317