astuetz / PagerSlidingTabStrip

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

After adding this line of code, the error is reported #325

Open WangXianSong opened 6 years ago

WangXianSong commented 6 years ago

app:pstsShouldExpand="true"

Error information :

Binary XML file line #20: Binary XML file line #20: Error inflating class com.astuetz.PagerSlidingTabStrip

kevintanhongann commented 5 years ago

Experienced this too. Any workarounds for this?

yuantingyu commented 5 years ago

So do i,and some xml attribute can not work as papers said.such as app:pstsDividerColor="#0011dd" app:pstsIndicatorColor="#FFFFA500" app:pstsUnderlineColor="#1d1c1b" app:pstsUnderlineHeight="45dp" and so on.it seems like the attribute are not in their right position. Yours problem can be solved by add like this in MainActivity

     PagerSlidingTabStrip tabsStrip=(PagerSlidingTabStrip)findViewById(R.id.tabs);
    //把标题和页面联系起来
    tabsStrip.setShouldExpand(true);
    tabsStrip.setViewPager(viewPager);