# setTabBarStyle
动态设置 tabBar(小程序底部tab栏) 的整体样式
# 支持说明
应用能力 | Android | iOS | PC | 预览效果 |
---|---|---|---|---|
小程序 | 3.0.0 | 3.0.0 | 3.5.0 | 扫码预览 用BoosHi扫码或PC端点击 |
网页应用 | X | X | X | / |
# 输入
继承标准对象输入,扩展属性描述:
名称 | 数据类型 | 必填 | 默认值 | 描述 |
---|---|---|---|---|
color | string | 是 | tab 上的文字默认颜色,6 位 HexColor 例如"#ff3377" 示例值:'#FF0000' | |
selectedColor | string | 是 | tab 上的文字选中时的颜色,6 位 HexColor 例如"#ff3377" 示例值:'#00FF00' | |
backgroundColor | string | 是 | tab 的背景色,6 位 HexColor 例如"#ff3377" 示例值:'#0000FF' | |
borderStyle | string | 是 | white | tabBar上边框的颜色, 仅支持 black/white 示例值:'white' 可选值: white :白black :黑 |
borderColor | string | 是 | tabBar上边框的颜色,优先级高于borderStyle 示例值:'#00FF00' |
# 输出
继承标准对象输出,无扩展属性
# 示例代码
bz.setTabBarStyle({
color: "#FF0000",
selectedColor: "#00FF00",
backgroundColor: "#0000FF",
borderStyle: "white",
borderColor: "#00FF00",
success(res) {
console.log(JSON.stringify(res));
},
fail(res) {
console.log(`setTabBarStyle fail: ${JSON.stringify(res)}`);
}
});
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
success
返回对象示例:
{
"errMsg": "setTabBarStyle:ok"
}
1
2
3
2
3
点击纠错