문제

How to change the background color of sliding tabs?

android:backgroundStacked property is not working for this one. It is working for fixed tabs.

도움이 되었습니까?

해결책 2

I finally figured out the method. First I need to mention that scrollable tabs are created using ViewPager.

(But in Fixed tabs we normally get a reference to the actionbar and then create tabs and add to actionbar)

Then we create the adapter and fragments to create the scrollable tabs. For more details about how to create scrollable tabs watch this video.

How to create scrollable tabs in android

What we see as a tab actually is the ViewPager. So simple thing is to change the background color of the ViewPager.So the entire page will get affected by the background color.

But in my case I have put a listview on top of the ViewPager using fragments. So it displays only the top part of the ViewPager which feels like colored scrollable tabs. I have put a screenshot as well for clarification.

enter image description here

다른 팁

Use this

http://jgilfelt.github.io/android-actionbarstylegenerator/

simply design whatever colors you want and copy those styles to your project .

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top