小工具知识网

当前位置: 首页 > 行业知识 > uniapp和小程序设置tabBar和显示与隐藏tabBar

行业知识

uniapp和小程序设置tabBar和显示与隐藏tabBar

2026-11-16 05:51:48 来源:互联网转载

(1)��置tabBar:

()
uni.setTabberItem({});
wx.setTabberItem({});
indexnumber是tabBar 的哪一项,从左边算起,索引从0开始
textstring否tab 上按钮文字
iconPathstring否图片路径
selectedIconPathstring否选中时的图片路径
pagePathstring否页面绝对路径
visibleboolean否tab 是否显示
uni.setTabBarItem({  index: 0,  text: 'text',  iconPath: '/path/to/iconPath',  selectedIconPath: '/path/to/selectedIconPath',  pagePath: 'pages/home/home'})
wx.setTabBarItem({  index: 0,  text: 'text',  iconPath: '/path/to/iconPath',  selectedIconPath: '/path/to/selectedIconPath',  pagePath: 'pages/home/home'})

(2)显示tabBar:

uni.showTabber();
wx.showTabber();

(3)隐藏tabBar:

()
uni.hideTabber();
wx.hideTabber();

上一篇:老年手机音乐下载指南

下一篇:怎么获得蓝蝶服务器?