TabLayout tab selection

前端 未结 25 1506
情深已故
情深已故 2020-11-29 17:15

How should I select a tab in TabLayout programmatically?

 TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
 tabLayout.setupWithViewPager(viewPager         


        
25条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 17:24

    Try this way.

    tabLayout.setTabTextColors(getResources().getColor(R.color.colorHintTextLight),
                               getResources().getColor(R.color.colorPrimaryTextLight));
    

提交回复
热议问题