I have used android.support.design.widget.TabLayout
in my application with Min SDK 15.
By default it takes Tab title in capitals but I want it to make in "textCapsWord". I tried adding Style as suggested here and here. But unfortunate both doesn't work.
You can change the font family for selected/unselected tab only programmatically. You can listen which Tab is selected and unselected with TabLayout. OnTabSelectedListener and on onTabSelected(TabLayout. Tab tab) callback you can change the Typeface for the selected Tab and on onTabUnselected(TabLayout.
Tab layout are visible below toolbar with View pager, used to create swipeable views . Tabs are designed to work with fragments. Use them to swipe fragments in view pager.
If you add the following line to your TabLayout
it should work:
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
Use it like this:
<android.support.design.widget.TabLayout android:id="@+id/tabLayout" android:layout_width="match_parent" android:layout_height="wrap_content" app:tabIndicatorColor="@android:color/white" app:tabIndicatorHeight="2dp" app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget" app:tabSelectedTextColor="@android:color/white" app:tabTextColor="@android:color/white" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With