# getSize
获取设备的尺寸。
# 输入
继承标准对象输入,无扩展属性
# 输出
继承标准对象输出,无扩展属性
Android:
| 变量名称 | 变量说明 |
|---|---|
| width | 屏幕的宽度 |
| height | 屏幕的高度 |
| statusBarHeight | 系统状态栏高度 |
iOS: 设备分辨率(pixel) = 逻辑分辨率(point) * scale_factor
| 变量名称 | 变量说明 |
|---|---|
| width | 设备分辨率的宽度 |
| height | 设备分辨率的高度 |
| statusBarHeight | 系统状态栏高度 |
| physical_width | 屏幕的宽度(逻辑分辨率) |
| physical_height | 屏幕的高度(逻辑分辨率) |
| scale_factor | 比例因子 |
# 示例代码
app.getSize(function(res){
app.alert(res);
});
← getInfo getDeivceId →