导航栏

有关导航栏的一些动画效果

wx.showNavigationBarLoading

在当前页面显示导航条加载动画

参数

Object object

呈现效果

wx.setNavigationBarTitle

动态设置当前页面的标题

参数

Object object

示例代码

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

呈现效果

wx.setNavigationBarColor

基础库 1.4.0 开始支持,低版本需做兼容处理。

设置页面导航条颜色

参数

Object object

object.animation 的结构

object.animation.timingFunc 的合法值

示例代码


wx.setNavigationBarColor({
  frontColor: '#ffffff',
  backgroundColor: '#ff0000',
  animation: {
    duration: 400,
    timingFunc: 'easeIn'
  }
})

呈现效果

wx.hideNavigationBarLoading

在当前页面隐藏导航条加载动画

参数

Object object

wx.hideHomeButton

基础库 2.8.3 开始支持,低版本需做兼容处理。

隐藏返回首页按钮。微信7.0.7版本起,当用户打开的小程序最底层页面是非首页时,默认展示“返回首页”按钮,开发者可在页面 onShow 中调用 hideHomeButton 进行隐藏。

参数

Object object

Last updated