初始化
tabHost = getTabHost(); TabSpec tabSpec = tabHost.newTabSpec("abc"); tabSpec.setIndicator("helloabc"); tabSpec.setContent(new MyViewFactory()); tabHost.addTab(tabSpec);动态更改indicator
TextView title = (TextView) tabHost.getTabWidget() .getChildAt(tabId).findViewById(android.R.id.title); title.setText("xyz"); 另外,indicator的参数也可以是view
本文介绍了如何在Android中动态更改TabHost的指示器(indicator),包括获取TabWidget、设置TextView作为指示器文本以及使用view作为指示器的方法。
1071

被折叠的 条评论
为什么被折叠?



