小程序安全区域信息。
所有字段单位均为逻辑像素,坐标原点是当前小程序可用窗口的左上角。Runtime 会把 四条边界夹取到窗口范围内,并保证 right >= left、bottom >= top;width 恒等于 right - left,height 恒等于 bottom - top。
right >= left
bottom >= top
width
right - left
height
bottom - top
Host 未提供安全区域或某条边界无效时,Runtime 分别以 left = 0、 right = windowWidth、top = statusBarHeight、bottom = windowHeight 降级,再把结果 夹取到当前窗口范围内。因此安全区域可能退化为零宽或零高矩形,但不会越过窗口边界。
left = 0
right = windowWidth
top = statusBarHeight
bottom = windowHeight
MiniProgramWindowInfoResult
安全区域下边界纵坐标;从窗口上边缘起算,且不小于 top。
top
安全区域高度,恒等于 bottom - top,单位逻辑像素。
安全区域左边界横坐标;从窗口左边缘起算,范围为 0 到 windowWidth。
0
windowWidth
安全区域右边界横坐标;从窗口左边缘起算,且不小于 left。
left
安全区域上边界纵坐标;从窗口上边缘起算,Host 未提供有效值时取 statusBarHeight。
statusBarHeight
安全区域宽度,恒等于 right - left,单位逻辑像素。
小程序安全区域信息。
备注
所有字段单位均为逻辑像素,坐标原点是当前小程序可用窗口的左上角。Runtime 会把 四条边界夹取到窗口范围内,并保证
right >= left、bottom >= top;width恒等于right - left,height恒等于bottom - top。Host 未提供安全区域或某条边界无效时,Runtime 分别以
left = 0、right = windowWidth、top = statusBarHeight、bottom = windowHeight降级,再把结果 夹取到当前窗口范围内。因此安全区域可能退化为零宽或零高矩形,但不会越过窗口边界。参阅
MiniProgramWindowInfoResult