tags:

views:

36

answers:

1

Hey,

I'm using the TabHost and TabWidget to create some tabs for an Android application. I see that the tabs show up vertically one next to the other. Is there any way to make tabs that are aligned horizontally (one on top of the other) ?.

I'm creating the tabs like this:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <TextView
            android:id="@+id/textview1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:text="this is a tab" />
        <TextView
            android:id="@+id/textview2"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:text="this is another tab" />            
    </FrameLayout>
</LinearLayout>

Something like this is what I need to do:

alt text

A: 

I'm not certain, but I don't think there's much you can do with the default behavior. Android's tab support in general seems a bit clunky to me. But let me know if you do get this working -- I might be able to use it myself!

FWIW, I did my own tab behavior using image buttons and other control elements. In my case, I was trying to come up with tabs that didn't use so much screen real estate.

gordonwd