7

I am using a tab bar in android.

By default, it displays at the top.

I want it to be displayed at the bottom.

Can someone please explain how to do this?

john.k.doe
  • 7,533
  • 2
  • 37
  • 64
Amandeep singh
  • 1,865
  • 7
  • 21
  • 41

3 Answers3

22

Please check this link: How to align your TabHost at the bottom of the screen

Adding android:layout_alignParentBottom="true" for the TabWidget does the trick.

Kannan Suresh
  • 4,573
  • 3
  • 34
  • 59
5

Just place content layout above tab widget. See following link for more info. Android: Tabs at the BOTTOM

Community
  • 1
  • 1
Vivek
  • 4,170
  • 6
  • 36
  • 50
2
<?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"
    android:padding="1dp" >

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

        <FrameLayout
            android:id="@android:id/tabcontent"
            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="wrap_content"
            android:layout_alignParentBottom="true" />
    </RelativeLayout>>

</TabHost>
Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295