Uniapp 打包后的横屏控制
问题
Uniapp
打包后的横竖屏跟开发模式不太一样,需要在代码里设置一下
处理
需要改两个地方
-
pages.json
:在globalStyle
中添加"pageOrientation": "auto",
-
manifest.json
:在第一层后面添加orientation
,
// pages.json "pageOrientation": "auto", // manifest.json "orientation" : [ "landscape-primary", "landscape-secondary" ] // orientation 有如下的可选项,我只需要横屏,所以上面只写了两个 "orientation" : [ //竖屏正方向 "portrait-primary", //竖屏反方向 "portrait-secondary", //横屏正方向 "landscape-primary", //横屏反方向 "landscape-secondary", //自然方向 "default" ]
参考
原文地址:https://blog.csdn.net/u010263423/article/details/142482910
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!