How to change the current tab highlighter color in Android ViewPager?

后端 未结 3 997
Happy的楠姐
Happy的楠姐 2021-02-03 23:36

Here is my layout inside ViewPager. I would like to change the color of the current tab highlighter which is below the text. Actually it is showing in black color.

3条回答
  •  佛祖请我去吃肉
    2021-02-04 00:10

    This just works.

    PagerTabStrip pagerTabStrip = (PagerTabStrip) findViewById(R.id.pager_title_strip);
    pagerTabStrip.setDrawFullUnderline(true);
    pagerTabStrip.setTabIndicatorColor(Color.RED);
    

    Thanks!

提交回复
热议问题