Home > Mobile >  PagerSlidingTabStrip underline the indicator that how to implement it custom length and center?
PagerSlidingTabStrip underline the indicator that how to implement it custom length and center?

Time:10-31

PagerSlidingTabStrip underline the indicator that how to implement it custom length and center? Can not find the demo, please have a true guidance

CodePudding user response:

Private int indicatorPadding=0;//definition about spacing
Again a bit package method: public void setIndicatorPadding (int indicatorPadding) {
Enclosing indicatorPadding=indicatorPadding;
Invalidate ().
}
Then in the protected void ontouch (Canvas Canvas) {

Canvas. DrawRect (lineLeft + indicatorPadding, height - indicatorHeight lineRight - indicatorPadding, height, rectPaint);

}

Then attributes defined in the outermost style of local calls this method and assignment mTabs. SetIndicatorPadding (120);

CodePudding user response:

On the second floor of this method doesn't work, and after all the indicator length is 120
  • Related