How to change android tab text on the fly?

后端 未结 7 1736
灰色年华
灰色年华 2021-01-04 01:42

This seems like it should be simple, but I can\'t figure out a way to do it. I\'m needing a tab to have beginning text, but then have that text change after the user selects

7条回答
  •  感动是毒
    2021-01-04 02:46

    TabWidget vTabs = .....;
    
    // get desired tab view  
    View vTab = vTabs.getChildAt(i);
    
    // I guess vTab is instance of TextView
    TextView vText = (TextView) vTab;
    
    vText.setText(...);
    

提交回复
热议问题