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://net2asp.com/8fdce3f4c8.html
