5***@qq.com
5***@qq.com
  • 发布:2020-10-12 16:38
  • 更新:2022-07-21 09:35
  • 阅读:1780

IOS在uniapp页面通过plus方式创建铺满整屏的webview,但webview底部有留白

分类:HTML5+

主要代码如下
<template>
<view class="page-container">
<!-- <view>
<web-view :src="webUrl" @message="getMessage"></web-view>
</view> -->
</view>
</template>

this.wv = plus.webview.create("/hybrid/html/page/login.html", 'webview-template-no-header', {  

                top: '0px', //放置在titleNView下方。如果还想在webview上方加个地址栏的什么的,可以继续降低TOP值  
                bottom: '0px',  
                scalable: true,  
                backButtonAutoControl: "close"  
            }, this.extras || {});  
            let currentWebview = this.$mp.page.$getAppWebview(); //获取当前页面的webview对象  

            currentWebview.append(this.wv); //一定要append到当前的页面里!!!才能跟随当前页面一起做动画,一起关闭  

login.html页面里的容器设置的是position:fixed,top:0,bottom:0,width:100% 期望是创建的webview铺满整个页面,但在苹果手机里实际效果如附件图中所示,底部有留白,android里正常,我图中的测试机是iphone5,ios12,我用iphonexs试了同样也有如下问题

2020-10-12 16:38 负责人:无 分享
已邀请:
DCloud_UNI_WZF

DCloud_UNI_WZF

plus.webview.create 中添加属性 'contentAdjust':false

要回复问题请先登录注册