How do you set text-color for a tab that's not selected? I know you can set the text-color for the TabLayout by doing: setTabTextColors
Choose Tab Color, and then select the color you want. The color of the tab changes, but not the color of the font.
It is possible to use a TabLayout without a ViewPager by using a TabLayout. OnTabSelectedListener . For navigation within an Activity , manually populate the UI based on the tab selected.
the method has slightly different on the time of its invocation, you just have to setup your tabitem to disable its click after all viewpager fragment already added.
Use app:tabTextColor
for default tab color and app:tabSelectedTextColor
for selected tab color.
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabTextColor="#000000"
app:tabSelectedTextColor="#FFFFFF"/>
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