tencent cloud

All product documents
Tencent Cloud Super App as a Service
Navigation Bar
Last updated: 2024-11-21 18:41:53
Navigation Bar
Last updated: 2024-11-21 18:41:53

setNavigationBarTitle

This API is used via wx.setNavigationBarTitle(Object object).
Feature Description: Dynamically sets the title of the current page.
Parameter and Description: Object.
Attribute
Type
Default value
Required
Description
title
string
-
Yes
Page title
success
function
-
No
Callback Function of Successful Interface Call
fail
function
-
No
Callback Function of Failing Interface Call
complete
function
-
No
Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
wx.setNavigationBarTitle({
title: 'Current Page'
})

setNavigationBarColor

This API is used via wx.setNavigationBarColor(Object object).
Feature Description: Set the color scheme for the page navigation bar.
Parameter and Description: Object.
Attribute
Type
Default value
Required
Description
frontColor
string
-
Yes
Foreground color value, including the color of buttons, title, and status bar, only supporting #ffffff and #000000.
backgroundColor
string
-
Yes
Background color value, with valid values being hexadecimal colors.
animation
object
-
No
Animation Effect
success
function
-
No
Callback Function of Successful Interface Call
fail
function
-
No
Callback Function of Failing Interface Call
complete
function
-
No
Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
Structure attributes of object.animation
Attribute
Type
Default value
Required
Description
duration
number
0
No
Animation transition duration, measured in milliseconds.
timingFunc
string
'linear'
No
Animation transition method
Valid values for object.animation.timingFunc
Value
Description
'linear'
The animation maintains a consistent speed from beginning to end.
'easeIn'
The animation starts at a slow pace.
'easeOut'
The animation concludes at a slow pace.
'easeInOut'
The animation starts and concludes at a slow pace.
Sample Code
wx.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#ff0000',
animation: {
duration: 400,
timingFunc: 'easeIn'
}
})

hideHomeButton

This API is used via wx.hideHomeButton(Object object).
Feature Description: Hide home button. When the bottom page of the mini program opened by the user is not the home page, the sharing panel will show the "Back to Home" button by default, and the developer can call hideHomeButton in the onShow of the page to hide it.
Parameter and Description: Object.
Attribute
Type
Default value
Required
Description
success
function
-
No
Callback Function of Successful Interface Call
fail
function
-
No
Callback Function of Failing Interface Call
complete
function
-
No
Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)

showNavigationBarLoading

This API is used via wx.showNavigationBarLoading(Object object).
Feature Description: Displays a navigation bar loading animation on the current page.
Parameter and Description: Object.
Attribute
Type
Default value
Required
Description
success
function
-
No
Callback Function of Successful Interface Call
fail
function
-
No
Callback Function of Failing Interface Call
complete
function
-
No
Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)

hideNavigationBarLoading

This API is used via wx.hideNavigationBarLoading(Object object).
Feature Description: Hides the navigation bar loading animation on the current page.
Parameter and Description: Object.
Attribute
Type
Default value
Required
Description
success
function
-
No
Callback Function of Successful Interface Call
fail
function
-
No
Callback Function of Failing Interface Call
complete
function
-
No
Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon