Android 在屏幕底部设置选项卡主机隐藏在类布局下方

Android 在屏幕底部设置选项卡主机隐藏在类布局下方,android,Android,嗨,朋友们,我想用下面的xml在屏幕底部设置tab host,当我在代码中实现时,它隐藏在我的类xml下面,所以如何摆脱这种情况…谢谢,我的代码在下面 <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:la

嗨,朋友们,我想用下面的xml在屏幕底部设置tab host,当我在代码中实现时,它隐藏在我的类xml下面,所以如何摆脱这种情况…谢谢,我的代码在下面

   <?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_height="fill_parent"
    android:layout_width="fill_parent">
    <TabWidget
        android:id="@android:id/tabs"
        android:layout_alignParentBottom="true"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />
      <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="5dp" />
   </RelativeLayout>
 </TabHost>


试试这个,我只是把tab小部件放在底部,还删除了relativeLayout。


<?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">
    <FrameLayout android:id="@android:id/tabcontent"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:paddingBottom="60dp">
        <LinearLayout android:id="@+id/calltabs_content"
            android:orientation="vertical" android:layout_width="fill_parent"
            android:layout_height="fill_parent">

        </LinearLayout>
    </FrameLayout>
    <RelativeLayout android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <TabWidget android:id="@android:id/tabs"
            android:layout_alignParentBottom="true" android:layout_width="fill_parent"
            android:layout_height="63dp" android:background="@drawable/background" />
    </RelativeLayout>
</TabHost>
试试这个,它似乎对我有用

<?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">
    <FrameLayout android:id="@android:id/tabcontent"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:paddingBottom="60dp">
        <LinearLayout android:id="@+id/calltabs_content"
            android:orientation="vertical" android:layout_width="fill_parent"
            android:layout_height="fill_parent">

        </LinearLayout>
    </FrameLayout>
    <RelativeLayout android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <TabWidget android:id="@android:id/tabs"
            android:layout_alignParentBottom="true" android:layout_width="fill_parent"
            android:layout_height="63dp" android:background="@drawable/background" />
    </RelativeLayout>
</TabHost>