tags:

views:

488

answers:

3
+1  Q: 

TabWidget Height

Is it possible to set the TabWidget height and have the tab labels adjust?

If I set the TabWidget height too small, then the labels are hidden from view.

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:padding="5dp">
            <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="fill_parent"
                android:layout_height="30px" />
            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:padding="5dp" />
    </LinearLayout>
</TabHost>

Thanks

+1  A: 

Android 1.6 added a setIndicator() method on TabSpec that accepts a View. I have not tried it yet, but my understanding is that it will give you greater control over the tabs.

CommonsWare
That should do the job. Thanks.
Steve
A: 

Tab hight is frame work dependent.you should customize it from there only or customize some other view to look like that.

Kantesh
A: 

i see... when u addTab, usually we use setIndicator like this: QTabHost.addTab(QTabHost.newTabSpec("tab_test2").setIndicator("TAB 2").bla bla....

u can use TextView to replace "TAB 2", became like this:

tview=new TextView(this); tview.setText("Title here"); QTabHost.addTab(QTabHost.newTabSpec("tab_test2").setIndicator(tview).bla bla....

all u need is just modify the textview. Thanks... ^^

Rubin Happy Ch.