开发者

How to show tabs At Bottom rather then at top?

I m having following screen,

How to show tabs At Bottom rather then at top?

开发者_JAVA百科

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

How to show tabs At Bottom rather then at top?

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


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>


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>


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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜