github android底部导航,Android 底部导航库 Ahbottomnavigation

软件介绍

Ahbottomnavigation 是采用 Material Design 风格设计的底部导航库,要求最小版本SDK为16,支持3~5个底部Item项,可以自行设置底部每个Item项的风格。

效果图:

66ee44ffec6fa5b78177d14d30126405.gif

767f2a60cb0bf9f97a1830b023b1ed5d.gif

cd2a8a26a7adce53adf96f00dab661c5.gif

使用示例

Gradle// Very soon on JCenter! ;)repositories {

maven {

url 'https://dl.bintray.com/aurelhubert/maven/'

}

}

dependencies {

compile 'com.aurelhubert:ahbottomnavigation:0.1.1'}

XML

android:id="@+id/bottom_navigation"

android:layout_width="match_parent"

android:layout_height="wrap_content"/>

Activity/FragmentAHBottomNavigation bottomNavigation = (AHBottomNavigation) findViewById(R.id.bottom_navigation);

// Create items

AHBottomNavigationItem item1 = new AHBottomNavigationItem("Label One", R.drawable.ic_maps_place, Color.parseColor("#455C65"));

AHBottomNavigationItem item2 = new AHBottomNavigationItem("Label Two", R.drawable.ic_maps_local_bar, Color.parseColor("#00886A"));

AHBottomNavigationItem item3 = new AHBottomNavigationItem("Label Three", R.drawable.ic_maps_local_restaurant, Color.parseColor("#8B6B62"));

// Add items

bottomNavigation.addItem(item1);

bottomNavigation.addItem(item2);

bottomNavigation.addItem(item3);

// Set background color

bottomNavigation.setDefaultBackgroundColor(Color.parseColor("#FEFEFE"));

// Change colors

bottomNavigation.setAccentColor(Color.parseColor("#F63D2B"));

bottomNavigation.setInactiveColor(Color.parseColor("#747474"));

// Use colored navigation with circle reveal effect

bottomNavigation.setColored(true);

// Set listener

bottomNavigation.setAHBottomNavigationListener(new AHBottomNavigation.AHBottomNavigationListener() {

@Override

public void onTabSelected(int position) {

// Do something cool here...

}

});

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值