需要导入Dimensions
let Dimensions = require('Dimensions');
// 示例
class KKScreen {
static width() {
return Dimensions.get('window').width;
}
static height() {
return Dimensions.get('window').height;
}
static scale() {
return Dimensions.get('window').scale;
}
}