Navigation Bar
setNavigationBarTitle
TIP
The API usage is as follows: wx.setNavigationBarTitle(Object object)
- Functional description: Dynamically set the title of the current page.
- Parameters and descriptions: Object object
| Properties | Type | Default value | Required | Description |
|---|---|---|---|---|
| title | string | - | Yes | Page title |
| success | Function | - | No | Callback function for successful interface call |
| fail | Function | - | No | Callback function for failed interface call |
| complete | Function | - | No | Callback function for interface call completion (executed regardless of success or failure) |
js
wx.setNavigationBarTitle({
title: 'current page'
})setNavigationBarColor
TIP
The API usage is as follows: wx.setNavigationBarColor(Object object)
- Functional description: Set the color of the page navigation bar.
- Parameters and descriptions: Object object
| Properties | Type | Default value | Required | Description |
|---|---|---|---|---|
| frontColor | string | - | Yes | Foreground color value, including the color of buttons, titles, and status bar, only supports #ffffff and #000008 |
| backgroundColor | string | - | Yes | Background color value, valid value is hexadecimal color |
| animation | object | - | No | Animation effect |
| success | Function | - | No | Callback function for successful interface call |
| fail | Function | - | No | Callback function for failed interface call |
| complete | Function | - | No | Callback function for interface call completion (executed regardless of success or failure) |
- Structural properties of object.animation
| Properties | Type | Default value | Required | Description |
|---|---|---|---|---|
| duration | number | 0 | No | Animation change time, unit ms |
| timingFunc | string | 'linear' | No | Animation change method |
Legal value of object.animation.timingFunc
Value Description 'linear' The speed of the animation from beginning to end is the same 'easeIn'' Animation starts at a low speed 'easeOut' Animation ends at a low speed 'easeInOut' Animation starts and ends at a low speed Sample code:
js
wx.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#ff0000',
animation: {
duration: 400,
timingFunc: 'easeIn'
}
})hideHomeButton
TIP
The API usage is as follows: wx.hideHomeButton(Object object)
- Functional description: Hide the return to home button. When the bottom page of the mini program opened by the user is not the home page, the sharing panel displays the 'return to home' button by default, and the developer can call hideHomeButton in the page onShow to hide it.
- Parameters and descriptions: Object object
| Properties | Type | Default value | Required | Description |
|---|---|---|---|---|
| success | Function | - | No | Callback function for successful interface call |
| fail | Function | - | No | Callback function for failed interface call |
| complete | Function | - | No | Callback function for interface call completion (executed regardless of success or failure) |
showNavigationBarLoading
TIP
The API usage is as follows: wx.showNavigationBarLoading(Object object)
- Functional description: Show the navigation bar loading animation on the current page.
- Parameters and descriptions: Object object
| Properties | Type | Default value | Required | Description |
|---|---|---|---|---|
| success | Function | - | No | Callback function for successful interface call |
| fail | Function | - | No | Callback function for failed interface call |
| complete | Function | - | No | Callback function for interface call completion (executed regardless of success or failure) |
hideNavigationBarLoading
TIP
The API usage is as follows: wx.hideNavigationBarLoading(Object object)
- Functional description: Hide the navigation bar loading animation on the current page.
- Parameters and descriptions: Object object
| Properties | Type | Default value | Required | Description |
|---|---|---|---|---|
| success | Function | - | No | Callback function for successful interface call |
| fail | Function | - | No | Callback function for failed interface call |
| complete | Function | - | No | Callback function for interface call completion (executed regardless of success or failure) |