How to show tabs At Bottom rather then at top?

后端 未结 3 765
清酒与你
清酒与你 2020-12-20 03:46

I m having following screen, \"enter

I am using Following code to make Layout to show

相关标签:
3条回答
  • 2020-12-20 04:34

    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 讨论(0)
  • 2020-12-20 04:49

    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>
    

    0 讨论(0)
  • 2020-12-20 04:50

    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>
    

    0 讨论(0)
提交回复
热议问题