HomeDocs
跳到主要内容

dlt.setTabBarStyle

简介​

动态设置 tabBar 的整体样式。

使用限制​

基础库从 4.0.0 或更高版本支持。

参数​

Object object

属性类型默认值必填说明
colorstring否tab 上的文字默认颜色,HexColor
selectedColorstring否tab 上的文字选中时的颜色,HexColor​
backgroundColorstring否tab 的背景色,HexColor
borderStylestring否tabBar 上边框的颜色, 仅支持 black/white
successfunction否接口调用成功的回调函数
failfunction否接口调用失败的回调函数
completefunction否接口调用结束的回调函数(调用成功、失败都会执行)

object.success 回调函数​

参数​

Object res​

属性类型说明
successstringtrue-成功

object.fail 回调函数​

参数​

Object res​

属性类型说明
successstringfalse-失败

示例代码​

// pages/index/index.js
Page({
setTabBarStyle() {
dlt.setTabBarStyle({​
color: '#2E74FF',​
selectedColor: '#35c208',​
backgroundColor: '#c2c6ce',​
borderStyle: 'white',
success: () => {
console.log("success");
},
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_private.mi@dlightek.com © 2024 MiniApp. All Rights Reserved.