2015-04-02 190 views

回答

1

你可以做這樣的事情:

TabHost host = (TabHost)view.findViewById(R.id.tab_host); 
TabWidget widget = host.getTabWidget(); 
for(int i = 0; i < widget.getChildCount(); i++) { 
View v = widget.getChildAt(i); 

// Look for the title view to ensure this is an indicator and not a divider. 
TextView tv = (TextView)v.findViewById(android.R.id.title); 
if(tv == null) { 
    continue; 
} 
v.setBackgroundResource(R.drawable.your_tab_selector_drawable); 
} 

檢查這個答案https://stackoverflow.com/a/15750561/3651574。 它會解決你的問題。乾杯!!

相關問題