美文网首页
uni-app IOS锁定窗口的侧滑返回功能

uni-app IOS锁定窗口的侧滑返回功能

作者: Giraffe_00 | 来源:发表于2020-07-03 14:08 被阅读0次
    单个窗口锁定

    方法一

    // #ifdef APP-PLUS
    var page = this.$mp.page.$getAppWebview();
    page.setStyle({ popGesture: 'none' });
    // #endif
    

    方法二

    // #ifdef APP-PLUS
    plus.webview.currentWebview().setStyle({
       'popGesture': 'none'
    });
    // #endif
    

    方法三 在pages.json该页面加入"popGesture": "none"

    "pages": [{
            "path": "pages/index/index",
            "style": {
                "navigationBarTitleText": "首页",
                "app-plus": {// App特定样式
                    "popGesture": "none"
                }
            }
        }]
    
    全局锁定

    打开manifest源码视图,app-plus下配 "popGesture": "none"

    // app-plus 节点是 App 特有配置。
    "app-plus": {
       "popGesture": "none"
    }
    //iOS上是否支持屏幕左边滑动关闭当前页面。默认是可关闭。设为none则不响应左滑动画。
    

    相关文章

      网友评论

          本文标题:uni-app IOS锁定窗口的侧滑返回功能

          本文链接:https://www.haomeiwen.com/subject/fpowxktx.html