标题:
微信小程序API tabBar
[打印本页]
作者:
vicky.yu
时间:
昨天 10:36
标题:
微信小程序API tabBar
wx.showTabBarRedDot(Object object)
基础库 1.9.0 开始支持,低版本需做兼容处理。
显示 tabBar 某一项的右上角的红点
参数
Object object
属性 类型 默认值 必填 说明
index number 是 tabBar 的哪一项,从左边算起
success function 否 接口调用成功的回调函数
fail function 否 接口调用失败的回调函数
complete function 否 接口调用结束的回调函数(调用成功、失败都会执行)
wx.showTabBar(Object object)
基础库 1.9.0 开始支持,低版本需做兼容处理。
显示 tabBar
参数
Object object
属性 类型 默认值 必填 说明
animation boolean false 否 是否需要动画效果
success function 否 接口调用成功的回调函数
fail function 否 接口调用失败的回调函数
complete function 否 接口调用结束的回调函数(调用成功、失败都会执行)
wx.setTabBarStyle(Object object)
基础库 1.9.0 开始支持,低版本需做兼容处理。
动态设置 tabBar 的整体样式
参数
Object object
属性 类型 默认值 必填 说明
color string 否 tab 上的文字默认颜色,HexColor
selectedColor string 否 tab 上的文字选中时的颜色,HexColor
backgroundColor string 否 tab 的背景色,HexColor
borderStyle string 否 tabBar上边框的颜色, 仅支持 black/white
success function 否 接口调用成功的回调函数
fail function 否 接口调用失败的回调函数
complete function 否 接口调用结束的回调函数(调用成功、失败都会执行)
示例代码
wx.setTabBarStyle({
color: '#FF0000',
selectedColor: '#00FF00',
backgroundColor: '#0000FF',
borderStyle: 'white'
})
欢迎光临 赛捷软件论坛 (http://www.sagesoft.cn/bbs/)
Powered by Discuz! 7.2