布局页
<com.hjm.bottomtabbar.BottomTabBar android:id="@+id/bottomTabBar" android:layout_width="match_parent" android:layout_height="match_parent" ></com.hjm.bottomtabbar.BottomTabBar>
代码页
public class MainActivity extends AppCompatActivity { //@BindView(R.id.bottomTabBar) BottomTabBar bottomTabBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); bottomTabBar=findViewById(R.id.bottomTabBar); initBottomTabBar(); } private void initBottomTabBar() { bottomTabBar.init(getSupportFragmentManager()) .setImgSize(200,150) .setFontSize(0) .setChangeColor(Color.RED,Color.GRAY) .addTabItem("",R.mipmap.ac1s2,R.mipmap.ac0s1, Home.class) .addTabItem("",R.mipmap.abxf2,R.mipmap.abwf1, Classify.class) .addTabItem("",R.mipmap.abzfa2,R.mipmap.abyfa1, Find.class) .addTabItem("",R.mipmap.abvg2,R.mipmap.abug1, Car.class) .addTabItem("",R.mipmap.ac3w2,R.mipmap.ac2w1, Mine.class) .isShowDivider(false); } }