1***@qq.com
1***@qq.com
  • 发布:2023-03-06 14:15
  • 更新:2023-03-06 15:13
  • 阅读:493

uniapp tabbar页面使用webview 会什么会挡了底部导航栏的tabbar?

分类:uni-app
h5端可以显示、APP里面是直接覆盖了。 vue版本2.0 tabbar是自己手写的自定义组件底部导航栏 在每个tabbar里面引用底部导航栏组件 <template> <!-- 底部导航 组件--> <view class="tabbar" :style="{'padding-bottom': paddingBottomHeight + 'rpx'}"> <view class="tabbar-item" v-for="(item, index) in list" :key="index" @click="tabbarChange(item.path)"> <view class="tabbar-item-box-synthesis" :class="current==index?'tabbar-item-box-synthesis-active':''" v-if="index==2"> <view class="tabbar-item-box-synthesis-c"> <image :src="item.icon" mode="" class="tabbar-item-box-synthesis-image"></image> <text class="tabbar-item-box-synthesis-text"

style="current==index?'color:#ffffff':''">{{item.text}}</text> </view>
</view>
<view class="tabbar-item-box" v-else>
<image class="item-img" :src="current == index?item.iconPath:item.icon"></image>
<text class="item-text" :class="current == index?'item-text-active':''">{{item.text}}</text>
</view>

</view>  

</view>
</template>

pages.json文件
"tabBar": {
"color": "#999999",
"selectedColor": "#1DD9A9",
"backgroundColor": "#ffffff",
"iconWidth": "24px",
"borderStyle": "white",
"height": "120px",
"list": [{
"pagePath": "pages/tabbar/home/index",
// "iconPath": "static/tabbar/home.png",
// "selectedIconPath": "static/tabbar/home_a.png",
"text": "Home"
},
{
"pagePath": "pages/tabbar/synthesis/index",
// "iconPath": "static/tabbar/home.png",
// "selectedIconPath": "static/tabbar/home_a.png",
"text": "synthesis"
},
{
"pagePath": "pages/tabbar/invite/index",
// "iconPath": "static/tabbar/home.png",
// "selectedIconPath": "static/tabbar/home_a.png",
"text": "Synthesis"
},
{
"pagePath": "pages/tabbar/mine/index",
// "iconPath": "static/tabbar/mine.png",
// "selectedIconPath": "static/tabbar/mine_a.png",
"text": "Mine"
},
{
"pagePath": "pages/tabbar/game/index",
// "iconPath": "static/tabbar/mine.png",
// "selectedIconPath": "static/tabbar/mine_a.png",
"text": "Game"
}
]
},

"pages/tabbar/game/index" 文件 引用
<template>
<view>
<web-view src="/hybrid/html/index.html" @message="getMessage">
</web-view>
<!-- 转盘抽奖弹窗 -->
<raffled-popup :show="raffledShow"></raffled-popup>
<!-- VIP弹窗 -->
<vip-popup :show="VipShow" @open="vipOpen" @close="vipClose"></vip-popup>
<!-- 排行榜弹窗 -->
<ranking-list :show="rankShow" @open="rankOpen" @close="rankClose"></ranking-list>
<Tabbar :current="'2'"></Tabbar>
</view>
</template>

附件图片就是 h5可以 APP内部直接覆盖

2023-03-06 14:15 负责人:无 分享
已邀请:
DCloud_UNI_WZF

DCloud_UNI_WZF

参考提交Bug模板提供运行平台,vue版本等信息,如有必要,提供测试工程,谢谢

1***@qq.com

1***@qq.com (作者) - 饶文俊

uniapp 嵌套web-view 在tabbar页面使用 会全屏加载
<web-view ref="webview" src="/hybrid/html/index.html" @message="getMessage" :webview-styles="webviewStyles">
</web-view>

  • DCloud_UNI_WZF

    App端测试未复现该问题,提供下测试工程吧

    2023-03-06 14:54

  • 1***@qq.com (作者)

    回复 DCloud_UNI_WZF: 使用的是自定义tabbar tabbar页面引用webview会遮挡tabbar 是因为层级太高的问题吗

    2023-03-07 10:12

  • 1***@qq.com (作者)

    回复 DCloud_UNI_WZF: vue版本2.0

    2023-03-07 10:22

  • DCloud_UNI_WZF

    回复 1***@qq.com: 自定义tabbar 是指 custom-tab-bar 还是啥

    2023-03-07 11:49

1***@qq.com

1***@qq.com (作者) - 饶文俊

h5是可以显示,APP里面显示不了

要回复问题请先登录注册