android - PagerSlidingTabStrip making horizontalscrollview's width fixed -
android - PagerSlidingTabStrip making horizontalscrollview's width fixed -
i'm using pagerslidingtabstrip library in application now. have 5 tabs, it's on screen width. have scroll see lastly tab.
i want see tabs on screen , never wanna scroll see other items.
i tried changing horizontalscrollview linearlayout in pagerslidingtabstrip.java it's weird little. indicator moved bad.
// public class pagerslidingtabstrip extends horizontalscrollview public class pagerslidingtabstrip extends linearlayout
and tried shouldexpand options true. didn't work again.
app:pstsshouldexpand="true"
what can ????
i had same problem next code ,i found if need set tabs shouldexpand need before setting viewpager tabs.
tabs = (pagerslidingtabstrip) findviewbyid(r.id.slidingtabstrip); //before setting view pager tabs.setshouldexpand(true); //works tabs.setviewpager(vppager); //after setting view pager tabs.setshouldexpand(true); //will not work
android pagerslidingtabstrip
Comments
Post a Comment