Android Tablayout indicator length modification

In fact, most of the time we meet these two needs, and a self-contained attribute can handle it.

app:tabIndicatorFullWidth="false", true is the first red arrow, false is the second. 
To modify the style of the indicator, modify it directly in the code:
tabThree.setSelectedTabIndicator(getResources().getDrawable(R.drawable.line));

Guess you like

Origin blog.csdn.net/qq_41873558/article/details/85163336