2

I am working in android. i want to reduce height of the tab widget. this is the image of my tab widget. enter image description here

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....

Pushpendra Kuntal
  • 6,118
  • 20
  • 69
  • 119

3 Answers3

9

use this code.

for (int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) {
            tabHost.getTabWidget().getChildAt(i).getLayoutParams().height /=2;

        }
Yashwanth Kumar
  • 28,931
  • 15
  • 65
  • 69
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;
DaveShaw
  • 52,123
  • 16
  • 112
  • 141
Treping
  • 59
  • 8
-1

You need to create Custom Tab for Customizing your Tab Bar.

Check my post for creating Custom tab Bar Custom Tab Bar

Community
  • 1
  • 1
Venky
  • 11,049
  • 5
  • 49
  • 66