Is there any way I can get the height of the tab bar in Android? Its getHeig开发者_StackOverflowht() method seems to only return 0.
Thanks!
Try this in your code .
for (int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) {
RelativeLayout relativeLayout =(RelativeLayout)tabHost.getTabWidget().getChildAt(i);
relativeLayout.getChildCount();
TextView tabhostText = (TextView) relativeLayout.getChildAt(1);
tabhostText.setTextSize(20.0f); // you can set the TextSize of your tab also
tabHost.getTabWidget().getChildAt(i).getLayoutParams().height = 30;
}
It will work .
精彩评论