I am trying to change the tab background color of the SlidingTabLayout described in (https://developer.android.com/samples/SlidingTabsBasic/src/com.example.android.common/view/SlidingTabLayout.html).
I managed to get the entire thing working. But when I change the tabresource color on line 183 for example:
textView.setBackgroundResource(R.color.white);
The background of the tab becomes white, but the indicator does not appear at all.
Can someone please advise on how to just change the background color but have the indicator work as usual?
Thank you.
Can't believe I missed this.
Put this in the constructor:
this.setBackgroundColor(context.getResources().getColor(R.color.tabBgColor));
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