Customize the font color and background of the top navigation

According to design requirements, implement custom navigation settings. There is a way to hide the top navigation in my blog, please find it yourself

1. Dynamically set the title of the current page wx.setNavigationBarTitle(OBJECT)
object parameter description:

1. Attribute: title-Type: String-Required: Yes-Description: Title of the page

2. Attribute: success-Type: Function-Required: No-Description: Callback function of successful interface call

3. Attribute: fail-Type: Function-Required: No-Description: Callback function for interface call failure

4. Attribute: complete-Type: Function-Required: No-Description: The callback function for the end of the interface call (the call will be executed if it succeeds or fails)

wx.setNavigationBarTitle({
   title:"当前页面"
})

2. Dynamically set the background color of the top navigation bar wx.setNavigationBarColor(OBJECT)
object parameter description:

Attribute-Type-Required-Description

1.fontColor-String-Yes-Foreground color value, including button, title, status bar color, only supports #fff and #000

2.backgroundColor-String-yes-background color, valid value is hexadecimal color

3.animation-Object-No-Animation effect

4.animation.duration-Number-No-Animation change time, default 0, unit (milliseconds)

5.animation.timingFunc-String-No-Animation change method, default linear

6.success-Function-No-Callback function for successful interface call

7.fail-Function-No-Callback function for interface call failure

8.complete- Function-No-Callback function for the end of the interface call (success or failure will be executed)

wx.setNavigationBarColor({
  frontColor:'#ffffff',
   backgroundColor:'#ff0000'
})

Guess you like

Origin blog.csdn.net/jiaodeqiangs/article/details/100599316