android tablayout 字体颜色,Tablayout变颜色 以及Fragment进行切换
生活随笔
收集整理的這篇文章主要介紹了
android tablayout 字体颜色,Tablayout变颜色 以及Fragment进行切换
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
第一步
在Xml 中
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/button"
>
第二步
在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);//是否顯示邊框
總結
以上是生活随笔為你收集整理的android tablayout 字体颜色,Tablayout变颜色 以及Fragment进行切换的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 小米盒子4 android版本,安卓系统
- 下一篇: 荣耀10x 鸿蒙,荣耀10X PRO渲染