一、全局横竖屏设置,在module.json5下,对当前UIAbility配置orientation,如下:
{
"module": {
"name": "entry",
"type": "entry",
...
"abilities": [
{
"name": "EntryAbility",
...
"orientation": "auto_rotation",
...
}
]
}
}
orientation属性列表如下:
orientation属性 | 描述 |
unspecified |
未指定方向,由系统自动判断显示方向 |
landscape |
横屏 |
portrait |
竖屏 |
landscape_inverted |