标签栏TarBar是移动端很常见的设计需求,但是默认的TabBar的定制性是很低的,所以往往我们需要自定义。而Taro既然立足于微信小程序开发,而微信小程序除了默认的TabBar还支持自定义TabBar,所以Taro其实也是可以像小程序一样自定义TabBar的。
微信小程序如何自定义TabBar这里不作展开,网上文章也很多,这里丢一个官方的地址:
先讲一下Taro默认怎么使用TabBar:
只需要在app.jsx的config中加入以下代码即可,相信大家看字面意思就明白怎么使用了
tabBar: {
color: 'rgba(68, 68, 68, 1)',
selectedColor: 'rgba(68, 68, 68, 1)',
backgroundColor: 'white',
list: [
{
pagePath: 'pages/home/home',
text: '首页',
iconPath: './image/ic_home_normal.png',
selectedIconPath: './image/ic_home_selected.png'
},
{
pagePath: 'pages/me/me',
text: '我的',
iconPath: './image/ic_me_normal.png',
selectedIconPath: './image/ic_me_selected.png'