Modify tab indicator dynamically in Android

后端 未结 3 1193
我寻月下人不归
我寻月下人不归 2021-02-13 13:55

My application needs to update tab indicator dynamically, I\'m trying to do this by invoke TabSpec.setIndicator(), but it doesn\'t work. Here is my code:

In onCreate met

相关标签:
3条回答
  • 2021-02-13 14:36

    Try this:

     TextView title = (TextView) TabHost.getTabWidget().getChildTabViewAt(tabId).findViewById(android.R.id.title);
    
    0 讨论(0)
  • 2021-02-13 14:39

    I apologize for my earlier incorrect answer, now deleted.

    Try using getChildViewAt() on TabWidget.

    0 讨论(0)
  • 2021-02-13 14:48

    i managaed with getChildTabViewAt(tabId) instead of childviewAt(id) for multiple tab.

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