2

I m having following screen, enter image description here

I am using Following code to make Layout to show tabhost and tab widget

enter image description here

I want to place the tabs at bottom . Please tell how to do this.

Abhi
  • 5,501
  • 17
  • 78
  • 133

3 Answers3

3

Hey I've done this using following code:

<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="5dp">

    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="5dp"
        android:layout_weight="1"/>

    <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0"/>

</LinearLayout>

Sergii
  • 1,521
  • 3
  • 24
  • 37
Abhi
  • 5,501
  • 17
  • 78
  • 133
1

Try this it comes below..In tab widget you have to specify the gravity of appereance of the Tab (i.e,) v

<LinearLayout android:orientation="vertical" android:background="#000000" android:id="@+id/tab"
    android:layout_width="fill_parent" android:layout_height="fill_parent">

    <TabWidget android:id="@android:id/tabs" android:background="@drawable/gradient_black"
        android:gravity="bottom" android:listSelector="#999999"
        android:layout_width="fill_parent" android:layout_height="63dip" />
</LinearLayout>

Venky
  • 11,049
  • 5
  • 49
  • 66
0

Following code shows Tabs at the bottom:

<?xml version="1.0" encoding="utf-8"?>
<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" >
    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true">
        </TabWidget>
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_above="@android:id/tabs">
        </FrameLayout>
    </RelativeLayout>
</TabHost>
Khawar
  • 5,197
  • 4
  • 28
  • 52