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

(1)设置tabBar:

uni.setTabberItem({});
wx.setTabberItem({});
index number tabBar 的哪一项,从左边算起,索引从0开始
text string tab 上按钮文字
iconPath string 图片路径
selectedIconPath string 选中时的图片路径
pagePath string 页面绝对路径
visible boolean 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();

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>