开源框架:底部导航栏 BottomNavigation

1.github地址

https://github.com/Ashok-Varma/BottomNavigation

2.Gradle导入

compile 'com.ashokvarma.android:bottom-navigation-bar:1.4.1'

3.使用

1.xml布局文件

    

2.dimens.xml中


    
    56dp 
    24dp 
    3dp 
    3dp 
    5dp 
    12sp 
    12sp 
    1 

3.java代码

        bottomBar = (BottomNavigationBar) findViewById(R.id.bottomBar);
        bottomBar.addItem(new BottomNavigationItem(R.drawable.ic_home_selected_24dp,"首页")
                        .setInactiveIconResource(R.drawable.ic_home_unselected_24dp));
        bottomBar.addItem(new BottomNavigationItem(R.drawable.ic_favorite_selected_24dp,"收藏")
                .setInactiveIconResource(R.drawable.ic_favorite_unselected_24dp));
        bottomBar.addItem(new BottomNavigationItem(R.drawable.ic_material_selected_24dp,"资料")
                .setInactiveIconResource(R.drawable.ic_material_unselected_24dp));
        bottomBar.initialise();

你可能感兴趣的:(开源框架:底部导航栏 BottomNavigation)