Skip to content Skip to sidebar Skip to footer

Reduce Tab Height And Align Text On Top?

how can i Reduce Tab height and align text on top? import android.app.TabActivity; import android.content.Intent; import android.os.Bundle; import android.widget.TabHost; public c

Solution 1:

just try this for increasing the height of the tabs :

 tabHost.getTabWidget().getChildAt(index).getLayoutParams().height =(int) height;

for text aligning try this in your xml layout :

android:gravity="top" or android:layout_gravity="top"

Solution 2:

use this code. It may work for you:

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

Solution 3:

You need to create a custom layout for your tab, inflate it and use setIndicator

Post a Comment for "Reduce Tab Height And Align Text On Top?"