Change the tabs text title in dynamic

前端 未结 2 1332
暗喜
暗喜 2021-01-12 00:41

I have a tablayout with four tabs under viewpager. I want to change the text title when i slide the tab. My problem is i can\'t handle tab respectively.

For instanc

相关标签:
2条回答
  • 2021-01-12 00:52

    try this

    tabLayoutHomePage.getTabAt(position).setText("new Text");
    
    0 讨论(0)
  • 2021-01-12 00:53

    This should also work

    mSlidingTabLayout.setTabText(position,name)

    0 讨论(0)
提交回复
热议问题