Skip to content

Screen (JavaScript) ​

Screen ​

Scripting Name:Insight.Screen

获取屏幕尺寸相关属性。

Static Properties ​


height ​

type : number

(只读)屏幕像素高度。

width ​

type :number

(只读)屏幕像素宽度。

Static Methods ​


NotchHeight ​

* From:SDK v2.0

javascript
static NotchHeight(): number;

刘海屏刘海区域的高度(非刘海屏为 0)。

⚠️android 9.0 系统下 OPPO 和 VIVO 拿不到用户打开或者关闭刘海屏的操作,我们的界面将默认是全屏的,UI 可以按照全面屏来适配。

-- sample:

javascript
local screenWidth = Insight.Screen.width;local screenHeight = Insight.Screen.height;local screenNotchHeight = Insight.Screen.NotchHeight();

ImageWidth ​

javascript
static ImageWidth(): number;

学习类算法,算法图像的宽。参考 https://near.yuque.com/docs/share/b168d197-b746-4699-bb5a-9f30eada47e7?# 《算法结果获取与使用》

ImageHeight ​

javascript
static ImageHeight(): number;

学习类算法,算法图像的高。参考 https://near.yuque.com/docs/share/b168d197-b746-4699-bb5a-9f30eada47e7?# 《算法结果获取与使用》