astuetz / PagerSlidingTabStrip

An interactive indicator to navigate between the different pages of a ViewPager
139 stars 44 forks source link

Tab Indicator Not showing when i change the tabbackground color #151

Closed bpr10 closed 9 years ago

bpr10 commented 9 years ago

When i set the tab background to white the indicator is not showing . and when i do not mak enay changes to the tab background then a underline same as the indicator color comes which does nt go even if a set underline color to transparent or make underline height to 0

mvojtkovszky commented 9 years ago

I can confirm this. Background overlays an underline. You can't spot the bug (?) as default background StateListDrawable is transparent.

mvojtkovszky commented 9 years ago

However.. this solved it: https://github.com/jpardogo/PagerSlidingTabStrip

zealot09 commented 9 years ago

It seems the tab backgroud will cover the indicator when config in the xml. It worked when setting the color in the activity

tabs = (PagerSlidingTabStrip)findViewById(R.id.tabs);
tabs.setBackgroundColor(Color.parseColor("#3f51b5"));
ekilah commented 9 years ago

depends on the color you want to use, but if for whatever reason you don't want to use an active fork like @biftekman posted, you can always use a semi-transparent background color.

uberchilly commented 9 years ago

You can use tabs.setBackgroundColor(Color.parseColor("#3D3D3D")); and it will work with underline and indicator but selector for each tab will be ugly and default bluish color. Fix for this would be to set selector as app1:pstsTabBackground="@drawable/tabs_background" with transparent main color and semitransparen pressed color: