当tabwidget被选中时,是否可以更改textview中textview的文本大小?
答案 0 :(得分:1)
是的,这是一个例子:
public class MainActivity extends TabActivity {
static TabHost mytabs;
mytabs = getTabHost();
mytabs.setOnTabChangedListener(new OnTabChangeListener() {
@Override
public void onTabChanged(String arg0) {
Log.i("TAG", "Im currently in tab with index: " + mytabs.getCurrentTab());
TabWidget tw = (TabWidget)tabHost.findViewById(android.R.id.tabs);
View tabView = tw.getChildTabViewAt(mytabs.getCurrentTab());
TextView tv = (TextView)tabView.findViewById(android.R.id.title);
// Changing textSize.
tv.setTextSize(20);
}
});