PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > 开发编程 > HBuilderX教程 > 正文

    uni-app如何禁止横屏或者禁止竖屏

    作者:admin来源:网络浏览:时间:2020-10-13 09:09:21我要评论
    导读:项目开发中我们经常需要禁止横屏或者禁止竖屏 ,B5教程网分享一下代码:
    项目开发中我们经常需要禁止横屏或者禁止竖屏 ,B5教程网分享一下代码:


    1. onLaunch: function () {   
    2.     // 锁定横屏   
    3.     // plus.screen.lockOrientation("landscape-primary");   
    4.     // 锁定竖屏   
    5.     plus.screen.lockOrientation("portrait-primary");   
    6. }, 

     

    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-146-6372-1.html