2011-03-23 82 views
2

我,m具有下面的屏幕, enter image description here如何显示标签底部而不是顶部?

我使用下面的代码进行布局,以显示tabhost和标签控件

enter image description here

我要放置标签的底部。 请告诉如何做到这一点。

+1

你为什么要发布您的代码为图像? – 2011-03-23 08:09:28

回答

3

嘿我做这个使用下面的代码:

<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

它不能与android.support.v4.app.FragmentTabHost一起使用。 PLZ建议 – 2012-12-12 10:37:06

1

试试这个涉及below..In标签控件必须指定的appereance的严重性Tab(ie)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

下面的代码显示在标签底部:

<?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> 
相关问题