HomeDocs
Skip to main content

dlt.setTabBarStyle

Introduction​

Dynamically set the overall style of the tabBar.

Usage Limitations​

Supported in the basic library version 4.0.0 or higher.

Parameters​

Object object

PropertyTypeDefaultRequiredDescription
colorstringNoDefault color of the text on the tab, HexColor.
selectedColorstringNoColor of the text on the tab when selected, HexColor.
backgroundColorstringNoBackground color of the tab, HexColor.
borderStylestringNoColor of the top border on the tabBar, only supports 'black' or 'white'.
successfunctionNoCallback function for a successful API call.
failfunctionNoCallback function for a failed API call.
completefunctionNoCallback function for the completion of the API call (executed whether the call is successful or not).

object.success Callback Function​

Parameters​

Object res​

PropertyTypeDescription
successstringtrue - Setting successful.

object.fail Callback Function​

Parameters​

Object res​

PropertyTypeDescription
successstringfalse - Setting failed.

Sample Code​

// 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.