The method of utilizing this API is wx.showTabBar(Object object).
Attributes | Types | Default value | Required | Note |
animation | boolean | false | Not required | Is animation effect necessary? |
success | function | - | Not required | Callback function for successful interface invocation |
fail | function | - | Not required | Callback function for unsuccessful interface invocation |
complete | function | - | Not required | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
The usage method for this API is wx.hideTabBar(Object object)
Attributes | Types | Default value | Required | Note |
animation | boolean | false | Not required | Is animation effect necessary? |
success | function | - | Not required | Callback function for successful interface invocation |
fail | function | - | Not required | Callback function for unsuccessful interface invocation |
complete | function | - | Not required | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
The usage method for this API is wx.setTabBarStyle(Object object)
Attributes | Types | Default value | Required | Note |
color | string | - | Not required | Default text color on the tab, HexColor |
selectedColor | string | - | Not required | Text color on the tab when selected, HexColor |
backgroundColor | string | - | Not required | Background color of the tab, HexColor |
borderStyle | string | - | Not required | Color of the border on the tab, only supports black/white |
success | function | - | Not required | Callback function for successful interface invocation |
fail | function | - | Not required | Callback function for unsuccessful interface invocation |
complete | function | - | Not required | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
The usage method for this API is wx.setTabBarItem(Object object)
Attributes | Types | Default value | Required | Note |
index | number | - | Supported | Which item of the tabBar, counting from the left |
text | string | - | Not required | Text on the tab button |
iconPath | string | - | Not required | Image path, the icon size is limited to 40kb, with a recommended dimension of 81px * 81px. This parameter is invalid when the position is set to 'top'. |
selectedIconPath | string | - | Not required | Path of the image when selected, the icon size is limited to 40kb, with a recommended dimension of 81px * 81px. This parameter is invalid when the position is set to 'top'. |
success | function | - | Not required | Callback function for successful interface invocation |
fail | function | - | Not required | Callback function for unsuccessful interface invocation |
complete | function | - | Not required | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
wx.setTabBarItem({index: 0,text: 'text',iconPath: '/path/to/iconPath',selectedIconPath: '/path/to/selectedIconPath'})
The usage of this API is wx.showTabBarRedDot(Object object)
Attributes | Types | Default value | Required | Note |
index | number | - | Supported | Which item of the tabBar, counting from the left |
success | function | - | Not required | Callback function for successful interface invocation |
fail | function | - | Not required | Callback function for unsuccessful interface invocation |
complete | function | - | Not required | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
The usage of this API is wx.hideTabBarRedDot(Object object)
Attributes | Types | Default value | Required | Note |
index | number | - | Supported | Which item of the tabBar, counting from the left |
success | function | - | Not required | Callback function for successful interface invocation |
fail | function | - | Not required | Callback function for unsuccessful interface invocation |
complete | function | - | Not required | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
The usage of this API is wx.setTabBarBadge(Object object)
Attributes | Types | Default value | Required | Note |
index | number | - | Supported | Which item of the tabBar, counting from the left |
text | string | - | Supported | The displayed text truncates to '...' if it exceeds 4 characters. |
success | function | - | Not required | Callback function for successful interface invocation |
fail | function | - | Not required | Callback function for unsuccessful interface invocation |
complete | function | - | Not required | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
wx.setTabBarBadge({index: 0,text: '1'})
The usage of this API is wx.removeTabBarBadge(Object object)
Attributes | Types | Default value | Required | Note |
index | number | - | Supported | Which item of the tabBar, counting from the left |
success | function | - | Not required | Callback function for successful interface invocation |
fail | function | - | Not required | Callback function for unsuccessful interface invocation |
complete | function | - | Not required | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
Was this page helpful?