@heybox/hb-sdk API Reference - v0.9.5
    正在准备搜索索引...

    接口 MiniProgramSafeArea

    小程序安全区域信息。

    所有字段单位均为逻辑像素,坐标原点是当前小程序可用窗口的左上角。Runtime 会把 四条边界夹取到窗口范围内,并保证 right >= left、bottom >= top;width 恒等于 right - left,height 恒等于 bottom - top。

    Host 未提供安全区域或某条边界无效时,Runtime 分别以 left = 0、 right = windowWidth、top = statusBarHeight、bottom = windowHeight 降级,再把结果 夹取到当前窗口范围内。因此安全区域可能退化为零宽或零高矩形,但不会越过窗口边界。

    interface MiniProgramSafeArea {
        bottom: number;
        height: number;
        left: number;
        right: number;
        top: number;
        width: number;
    }
    索引

    属性

    bottom: number

    安全区域下边界纵坐标;从窗口上边缘起算,且不小于 top。

    height: number

    安全区域高度,恒等于 bottom - top,单位逻辑像素。

    left: number

    安全区域左边界横坐标;从窗口左边缘起算,范围为 0 到 windowWidth。

    right: number

    安全区域右边界横坐标;从窗口左边缘起算,且不小于 left。

    top: number

    安全区域上边界纵坐标;从窗口上边缘起算,Host 未提供有效值时取 statusBarHeight。

    width: number

    安全区域宽度,恒等于 right - left,单位逻辑像素。