Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to dynamically set the title of the current page in WeChat Mini Programs's development

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

In this article entitled "how to dynamically set the title of the current page in the development of WeChat Mini Programs", the sample code is introduced in great detail and has a certain reference value. Interested friends must refer to it. For "how to dynamically set the title of the current page in the development of WeChat Mini Programs", the editor sorted out the following knowledge points, please follow the pace of the editor to understand step by step Next, let's get to the subject.

Wx.setNavigationBarTitle (OBJECT) dynamically sets the title of the current page.

OBJECT parameter description:

Parameter type required indicates that titleString is the page title successFunction No API call successful callback function failFunction No API call failed callback function completeFunction No API call ends callback function (both successful and failed calls will be executed)

Sample code:

Wx.setNavigationBarTitle ({title: 'current page'}) wx.showNavigationBarLoading ()

Displays the navigation bar on the current page to load the animation.

Wx.hideNavigationBarLoading ()

Hide the navigation bar to load the animation.

Wx.setNavigationBarColor (OBJECT)

The basic library 1.4.0 is supported, and the lower version needs to be compatible.

OBJECT parameter description:

Parameter name type is required to indicate that frontColorString is the foreground color value, including the color of button, title and status bar. Only # ffffff and # 000000backgroundColorString are background color values. Valid values are hexadecimal color animationObjectNo animation effect animation.durationNumber No animation change time, default 0, unit: millisecond animation. TimingFunction string No animation change mode Default linearsuccessFunction No API calls successful callback function failFunction No API calls failed callback function completeFunction No API calls the finished callback function (both successful and failed calls will be executed)

Valid values for animation.timingFunc:

The value indicates that the speed of the linear animation is the same from beginning to end. EaseIn animation starts at a low speed and easeOut animation ends at a low speed. EaseInOut animation begins and ends at a low speed.

Success return parameter description:

The parameter name type describes the result of the errMsgString call

Sample code:

Wx.setNavigationBarColor ({frontColor:'# ffffff', backgroundColor:'# ff0000', animation: {duration: 400, timingFunc: 'easeIn'}}) what does Mini Program mean? Mini Program is an application that can be used without download or installation. It can be used immediately by scanning a QR code or searching it. It is easy to operate and easy to spread. It can realize seven functions, such as message notification, offline scanning code, official account association and so on. It is based on Wechat, similar to APP. You can use it whenever you want. After using it, you will leave without taking up memory.

The above is all the contents of the article "how to dynamically set the title of the current page in WeChat Mini Programs's development". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report