Bo Z
Bo Z

Reputation: 2607

Tab layout tab does not change background color

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

Answers (1)

Abhishek
Abhishek

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

Related Questions