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();

版权声明:本文为博主作者:前端小凯原创文章,版权归属原作者,如果侵权,请联系我们删除!

原文链接:https://blog.csdn.net/qq_43235503/article/details/132792177

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
xiaoxingxing的头像xiaoxingxing管理团队
上一篇 2024年4月1日
下一篇 2024年4月1日

相关推荐