#鸿蒙学习大百科#如何配置才可以使屏幕可以自动进行横竖屏切换?

如何配置才可以使屏幕可以自动进行横竖屏切换?

HarmonyOS
2024-10-29 09:39:01
729浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
鹈鹕说蟹蟹你

orientation配置为auto_rotation可以实现。

{
  "name": "EntryAbility",
  "srcEntry": "./ets/entryability/EntryAbility.ets",
  "description": "$string:EntryAbility_desc",
  "icon": "$media:layered_image",
  "label": "$string:EntryAbility_label",
  "startWindowIcon": "$media:startIcon",
  "startWindowBackground": "$color:start_window_background",
  "exported": true,
  "launchType": "multiton",
  "orientation": "auto_rotation",// // 随传感器旋转 
  "skills": [
    {
      "entities": [
        "entity.system.home"
      ],
      "actions": [
        "action.system.home"
      ]
    }
  ]
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
分享
微博
QQ
微信
回复
2024-10-29 15:36:03


相关问题