修改tabbar文字内容,图片
uni.setTabBarItem({
index: 0,//tabBar 的哪一项,从左边算起
text: 'text',// tab 上的按钮文字
iconPath: '/path/to/iconPath',//图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,当 position 为 top 时,此参数无效,不支持网络图片
selectedIconPath: '/path/to/selectedIconPath'// 选中时的图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px ,当 position 为 top 时,此参数无效
})
隐藏\显示tabbar
uni.showTabBar();//显示
uni.hideTabBar();//隐藏
某一项tabbar右上角添加、移除,文本
//添加
uni.setTabBarBadge({
index: 0,//tabBar的哪一项,从左边算起
text: '1'//显示的文本,不超过 3 个半角字符
})
//移除
uni.removeTabBarBadge({
index: 0,//tabBar的哪一项,从左边算起
})
某一项tabbar右上角添加、隐藏,红点
//添加
uni.showTabBarRedDot({
index: 0,//tabBar的哪一项,从左边算起
})
//隐藏
uni.hideTabBarRedDot({
index: 0,//tabBar的哪一项,从左边算起
})