Reputation: 2607
Please help. Have already tried all existing solutions but it does not work. There is the part of the code
tabLayout.getTabAt(2)?.customView?.setBackgroundColor(Color.parseColor("#000000"))
Upvotes: 0
Views: 81
Reputation: 682
Instead of customView()
use getCsutomView()
. Code should be like:
tabLayout.getTabAt(2)?.getCustomView?.setBackgroundColor(Color.parseColor("#000000"))
This should fix your problem.
Upvotes: 1