底部导航栏

一、导依赖

compile 'com.hjm:BottomTabBar:1.1.1' 

二、Xml布局中

  1. android:id="@+id/bottom_tab_bar"

  2. android:layout_width="match_parent"

  3. android:layout_height="match_parent"

  4. >

三、Activity中,把它放在initView方法中
 
  1. bottom_tab_bar.init(getSupportFragmentManager())

  2. .setImgSize(50, 50)

  3. .setFontSize(20)

  4. .setChangeColor(Color.RED, Color.DKGRAY)

  5. .addTabItem("主页",null,null, OneFragment.class)

  6. .addTabItem("发现", null, null, TwoFragment.class)

  7. .addTabItem("成长", null, null, ThreeFragment.class)

  8. .addTabItem("我的", null, null, FourFragment.class)

  9. .isShowDivider(false);

你可能感兴趣的:(底部导航栏)