解决uniapp调试时,浏览器调试正常但真机调试有底部空白tabbar的问题

问题描述

使用自定义导航栏,在page.json页面用height为0的方式隐藏原生底部tabbar,但真机调试时会显示出空白的tabbar,如图:

浏览器中:

真机调试:

隐藏原生tabbar方式(page.json):

"tabBar": {
		"custom": true,
		"color": "#7A7E83",
		"selectedColor": "#007AFF",
		"borderStyle": "black",
		"backgroundColor": "#ffffff",
		"height": "0",
		"fontSize": "15px",
		"list": [{
				"pagePath": "pages/FirstPage/FirstPage",
				"text": ""
			},
			{
				"pagePath": "pages/To-DoList/To-DoList",
				"text": ""
			},
			{
				"pagePath": "pages/Gallery/Gallery",
				"text": ""
			},
			{
				"pagePath": "pages/Mine/Mine",
				"text": ""
			}
		]
	},

问题解决:

在自定义导航栏页面,页面开始时使用uniapp原生方法:uni.hideTabBar()

created() {
			uni.hideTabBar()
		}

猜你喜欢

转载自blog.csdn.net/qq_39210364/article/details/139580045