react-native-tabbar-animated 导航tabbar动画

自己封装的方法,欢迎star

react-native-tabbar-animated

the animated of tabbar

前言

该组件主要是做一个小动画,目前用在tabbar上面,当然其他地方也可以用,可能其他地方适配不太好.

github 仓库地址

react-native-tabbar-animated

gif 项目中的效果

[图片上传失败...(image-3020b9-1512637166796)]

install 安装

npm install react-native-tabbar-animated

use 使用

1.导入
import {CustomAnimation} from 'react-native-tabbar-animated'

2.使用在react-navigation 的 TabNavigator
<CustomAnimation animationStyle={'linear'} imageAddress={require('../img/nav-bar-mall-selected.png')} />

demo:

Main: {
screen: Mall,
navigationOptions: ({screenProps}) =>({
title: '商城',
tabBarLabel:({ focused }) =>( focused?'置顶':'商城'),
tabBarIcon: ({ tintColor,focused }) =>
( focused? <CustomAnimation animationStyle={'linear'} imageAddress={require('../img/nav-bar-mall-selected.png')} />
:
<Image source={!focused ? require('../img/nav-bar-mall.png') : require('../img/nav-bar-mall-selected.png') }
style={ styles.icon }
/>
)

}),
},

api 方法

方法都是可选,根据需要加入

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容