my.setTabBarStyle

Use this API to set the overall style of the tab bar, such as the text color, background color and border style.

For more information, see Tab bar FAQ.

Note:

Currently simulation in IDE is not supported. Please debug in production environment.

Sample Code

copy
my.setTabBarStyle({
    color: '#FF0000',
    selectedColor: '#00FF00',
    backgroundColor: '#0000FF',
    borderStyle: 'white'
})

Parameters

PropertyType

Required

Description
colorHexColorYesThe default color of text on tab.
selectedColorHexColorYesThe color of the selected text on tab.
backgroundColorHexColorYes The background color of tab.
borderStyleStringYesThe border color of tab bar, which only supports black / white.
successFunctionNoThe callback function for a successful API call.
failFunctionNoThe callback function for a failed API call.
completeFunctionNoThe callback function used when the API call is completed. This function is always executed no matter the call succeeds or fails.