my.setTabBarStyle
Use this API to set the overall style of the tab bar, such as the text color, background color and border style.
Supported types of mini programs: DSL
Note: Currently simulation in IDE is not supported. Please debug in production environment. For more information, see Tab bar FAQ.
Sample Code
copy
my.setTabBarStyle({
color: '#FF0000',
selectedColor: '#00FF00',
backgroundColor: '#0000FF',
borderStyle: 'white'
})Parameters
| Property | Type | Required | Description |
| color | HexColor | Yes | The default color of text on tab. |
| selectedColor | HexColor | Yes | The color of the selected text on tab. |
| backgroundColor | HexColor | Yes | The background color of tab. |
| borderStyle | String | Yes | The border color of tab bar, which only supports black / white. |
| success | Function | No | The callback function for a successful API call. |
| fail | Function | No | The callback function for a failed API call. |
| complete | Function | No | The callback function used when the API call is completed. This function is always executed no matter the call succeeds or fails. |