# setPageOrientation
设置页面横、竖屏配置
提示
小程序的横竖屏配置,可以通过globalStyle.pageOrientation
。参考链接
# 支持说明
应用能力 | Android | iOS | PC | 预览效果 |
---|---|---|---|---|
小程序 | - | - | - | / |
网页应用 | 3.18.0 | 3.18.0 | - | / |
# 输入
继承标准对象输入,扩展属性:
名称 | 数据类型 | 属性 | 默认值 | 描述 |
---|---|---|---|---|
orientation | string | 必须 | - | portrait : 竖屏,landscape : 横屏 |
# 输出
无
# 示例代码
bz.setPageOrientation({
orientation: 'landscape',
success () {
console.log(`setPageOrientation successfully`);
},
fail () {
console.log(`Failed to setPageOrientation`);
}
});
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9