How to change android tab text on the fly?

后端 未结 7 1735
灰色年华
灰色年华 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

    Here is your layout:

    
    
        
    
        
    
        
    
    
    

    Here is your code:

    TabLayout tabLayout = findViewById(R.id.ref_tabs);
    tabLayout.getTabAt(0).setText("BOOK"));
    tabLayout.getTabAt(1).setText("CHAPTER"));
    tabLayout.getTabAt(2).setText("VERSE"));
    

提交回复
热议问题