如何实现应用的屏幕自动旋转
=============

1.  在module.json5添加属性"orientation": "auto\_rotation"。
    
    如下所示：
    
    "abilities": \[
      {
        "name": "EntryAbility",
        "srcEntry": "./ets/entryability/EntryAbility.ets",
        "description": "$string:EntryAbility\_desc",
        "icon": "$media:icon",
        "label": "$string:EntryAbility\_label",
        "startWindowIcon": "$media:startIcon",
        "startWindowBackground": "$color:start\_window\_background",
        "exported": true,
        "skills": \[
        _  // ..._
        \],
        "orientation": "auto\_rotation", _// Rotate with the sensor_
      }
    \],
    
2.  打开手机自动旋转功能，操作步骤：进入手机控制中心 > 关闭旋转锁定。

**参考链接**

[abilities标签](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/module-configuration-file#abilities标签)