依赖: compile 'com.hjm:BottomTabBar:1.1.1'
布局:
xmlns:hjm="http://schemas.android.com/apk/res-auto"
<com.hjm.bottomtabbar.BottomTabBar
android:id="@+id/bottomtabar"
android:layout_width="match_parent"
android:layout_height="match_parent"
hjm:tab_img_height="25dp"
hjm:tab_img_width="25dp"
hjm:tab_selected_color="#f00"
hjm:tab_unselected_color="#000"
hjm:tab_bar_background="#fff"
hjm:tab_font_size="8dp"
></com.hjm.bottomtabbar.BottomTabBar>
使用:
bottomtabar.init(getSupportFragmentManager())
.addTabItem("首页", R.mipmap.shouye, FreagmentOne.class)
.addTabItem("分类", R.mipmap.fenlei, FreagmentTwo.class)
.addTabItem("发现", R.mipmap.homepage, FreagmentThree.class)
.addTabItem("购物车", R.mipmap.gouwuche, FreagmentFour.class)
.addTabItem("我的", R.mipmap.wode, FreagmentFive.class);