uni-app鸿蒙无法设置横屏
uni-app鸿蒙无法设置横屏
鸿蒙无法设置横屏?
已经全局globalStyle 设置"landscape": true,“pageOrientation”: “landscape”,
每个页面style也是设置"landscape": true,“pageOrientation”: “landscape”,
仍然无法起效,需要在编译之后生成的module.json5修改"orientation": "landscape"才行,每次修改麻烦到死
难道不支持吗?
暂未开放。如果你需要个别页面方向切换可以封装 uts 设置全屏,应用横屏你可以直接修改 moduel.json 正确放入到 harmony-configs 即可,不需要每次修改
更多关于uni-app鸿蒙无法设置横屏的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
我的是应用全部横屏,你能给一个具体harmony-configs的写法吗?我放在/harmony-configs/entry/src/main/module.json5中abilities[0]数组中设置"orientation": “landscape”,但是这样的话直接编译不了,会报错5 开始制作运行包 .hap,请耐心等待 … 12:53:40.412 > hvigor hvigor client: Starting hvigor daemon. 12:53:40.412 > hvigor Hvigor Daemon started in 260 ms 12:53:40.412 > hvigor ERROR: 00303196 Configuration Error 12:53:40.412 Error Message: Unable to obtain the module type at file: /Users/Zhuanz/Desktop/project/hongmeng2/1_child_traffic/unpackage/dist/dev/app-harmony/entry/src/main/module.json5 12:53:40.412 * Try the following: 12:53:40.412 > Make sure the module.type field is set correctly in the module.json5 file: /Users/Zhuanz/Desktop/project/hongmeng2/1_child_traffic/unpackage/dist/dev/app-harmony/entry/src/main/module.json5 12:53:40.412 > hvigor ERROR: BUILD FAILED in 801 ms 12:53:40.913 运行包制作失败
是不是得第一次编译之后,把编译之后的 moduel.json 修改之后复制放入到 harmony-configs?如何发布上线版本也会起效对吧

