I am working in android. i want to reduce height of the t开发者_C百科ab widget. this is the image of my tab widget.
I have added my tab widget in the bottom, 0,1,2,3 etc.
i want to reduce the height of tabwidget then the displaying digits(0,1,2,3) disappears. this is my xml for the page.:-
whenver i reduce the size of height then content does not display.
please suggest me what should i do for this. Thank you in advance....
use this code.
for (int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) {
tabHost.getTabWidget().getChildAt(i).getLayoutParams().height /=2;
}
use this to specified in pixel
float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 45, getResources().getDisplayMetrics());
tab_widget.getChildAt(i).getLayoutParams().height = (int)px;
You need to create Custom Tab for Customizing your Tab Bar.
Check my post for creating Custom tab Bar Custom Tab Bar
精彩评论