获取屏幕分辨率
以下为ES6的写法:
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Dimensions,
} from 'react-native';
const {screenWidth,screenHeight} = Dimensions.get('window')
在使用时直接用screenWidth,screenHeight
就可以获取屏幕的宽高。