react-native 获取手机宽度高度

首先引入组件
import {Dimensions} from 'react-native';

{Dimensions.get('window').width+'\n'}

{Dimensions.get('window').height+'\n'}

{Dimensions.get('window').scale+'\n'}

posted @ 2020-03-06 15:57  帖子搬运工  阅读(330)  评论(0编辑  收藏  举报