第一步java
在Xml 中android
<com.hjm.bottomtabbar.BottomTabBar android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/button" ></com.hjm.bottomtabbar.BottomTabBar>
第二步ide
在java代码zhong字体
button = (BottomTabBar) findViewById(R.id.button); button.init(getSupportFragmentManager()) .setImgSize(50, 50)//图片大小 .setFontSize(20)//字体大小 .setTabPadding(4, 6, 10)//内边距 .setChangeColor(Color.RED, Color.GREEN)//选中和未选中颜色 .addTabItem("第一项", null, AFragment.class) .addTabItem("第二项", null, BFragment.class) .setTabBarBackgroundColor(Color.WHITE)//背景色 .isShowDivider(false);//是否显示边框