android中的标签主机问题

时间:2012-01-31 06:42:12

标签: android android-layout android-emulator android-intent android-widget

我想在屏幕底部显示一个标签,所以我使用

<TabHost
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <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" >
        </FrameLayout>

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@android:id/tabcontent" />
    </RelativeLayout>
</TabHost>

但也希望在标签小部件下方显示一个按钮。在屏幕的底部,我们有一个按钮和一个标签小部件,它位于按钮上方,但应位于屏幕的底部。

有任何方法可以做到这一点。

请建议我使用可用的链接或示例代码。

2 个答案:

答案 0 :(得分:2)

使用线性布局并将tabhost和按钮放入其中

答案 1 :(得分:0)

我不确定,但采取一个线性或相对布局。 首先放置TabHost,然后在TabHost下面的新布局中放置一个按钮。

我没有使用它,但我认为它会起作用

相关问题