Android开源底部导航,一个开源JPTabBar for Android,炫酷的底部导航栏

JPTabBar

TabBar这个名字相信很多学过一点IOS程序员都知道它是用来干嘛的,但本人也并非擅长开发IOS程序员,只是略懂略懂....这是一个很强大的TabBar,可满足很多需求。用起来也非常简单,在oncreate只调用一行代码就把UI布局和切换页面功能基本都实现了。具体实现的功能,请看效果图:

68a18a0351cd

![3.gif](http://upload-images.jianshu.io/upload_images/3417927-88f405b34e51ab57.gif?imageMogr2/auto-orient/strip)

使用方法:

1.引入Gradle依赖

repositories {

jcenter()

}

dependencies{

compile 'com.jpeng:JPTabBar:1.1.0'

}

2.在你的主页面XML,在适当位置添加下面代码

android:id="@+id/tabbar"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:background="#fff"/>

3.在你的Activity里面声明注解变量。(seleIcons和BadgeModes可以不声明,还有你要确保你全部数组的长度是一样的)

@Titles

private static final String[] mTitles = {"页面一","页面二","页面三","页面四"};

@SeleIcons

private static final int[] mSeleIcons = {R.mipmap.tab1_selected,R.mipmap.tab2_selected,R.mipmap.tab3_selected,R.mipmap.tab4_selected};

@NorIcons

private static final int[] mNormalIcons = {R.mipmap.tab1_normal, R.mipmap.tab2_normal, R.mipmap.tab3_normal, R.mipmap.tab4_normal};

经过上面的设置后,基本上就可以把一个底部的UI搭建了!

但还有一步,想达到Wechat那种渐变和自动切换ViewPager就使用这个方法。

//调用TabBar的setContainer方法,传入 ? extends ViewPager

mTabBar.setContainer(mViewpager);

其他的,还有很多结点和方法说明,具体在Github:

开发者反馈:

假如你有什么需求或者发现BUG,什么的,可以直接发我邮箱:83508440@qq.com,或者直接在Github上issue!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值