在manifest.json--app-plus节点中添加下面代码,ipad端支持横屏和竖屏了,但是手机端plus.screen.lockOrientation('portrait-primary'); // 锁定竖屏这个就失效了,也可以横竖屏旋转了。如果给screenOrientation中只配置portrait-primary这个,手机端竖屏了,但是ipad(平板)方向不能横屏了,求助大家,看怎么解决。
"screenOrientation": [
"portrait-primary", //可选,字符串类型,支持竖屏
"portrait-secondary", //可选,字符串类型,支持反向竖屏
"landscape-primary", //可选,字符串类型,支持横屏
"landscape-secondary" //可选,字符串类型,支持反向横屏
],
旧时光 (作者)
感谢回复,我试了这个方法,没有生效,重新打包了,是还需要啥配置吗
2025-06-27 16:36
旧时光 (作者)
回复 旧时光: 哈哈,我知道了,你写错了,正确写法详见:https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-ios.html#orientation
2025-06-27 16:59