项目中需要获取手机的尺寸 import {Dimensions} from "react-native" var WINDOW = Dimensions.get("window"); var width = WINDOW.width; var height = WINDOW.height; var scale = WINDOW.scale; 其中 width, height, scale分别为宽,高,缩放因子,注意react-native对屏幕分辨率进行了统一的封装…
官方API: A structure describing general information about a display, such as its size, density, and font scaling. To access the DisplayMetrics members, initialize an object like this: DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().g…