HarmonyOS ArkTS 横竖屏设置

[复制链接]
发表于 2026-2-19 10:48:11 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
一、全局横竖屏设置,在module.json5下,对当前UIAbility设置orientation,如下:
  1. {
  2.   "module": {
  3.     "name": "entry",
  4.     "type": "entry",
  5.     ...
  6.     "abilities": [
  7.       {
  8.         "name": "EntryAbility",
  9.         ...
  10.         "orientation": "auto_rotation",
  11.         ...
  12.       }
  13.     ]
  14.   }
  15. }
复制代码
orientation属性列表如下:
orientation属性        形貌
  1. unspecified
复制代码
未指定方向,由体系自动判断体现方向
  1. landscape
复制代码
横屏
  1. portrait
复制代码
竖屏
  1. landscape_inverted
复制代码

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!qidao123.com:ToB企服之家,中国第一个企服评测及软件市场,开放入驻,技术点评得现金
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表