Android 选项卡活动选项卡不显示在前面

Android 选项卡活动选项卡不显示在前面,android,Android,我的选项卡布局有问题。当我启动TabActivity时,选项卡显示在背景中,而不是顶部。为什么会这样 TabsActivity: public class TabSample extends TabActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCr

我的选项卡布局有问题。当我启动TabActivity时,选项卡显示在背景中,而不是顶部。为什么会这样

TabsActivity:

public class TabSample extends TabActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tabactivity);
        TabHost tabHost = getTabHost();       

        tabHost.addTab(tabHost.newTabSpec("tab1").setIndicator("ABC").setContent(new Intent(this, SettingsActivity.class)));
        tabHost.addTab(tabHost.newTabSpec("tab2").setIndicator("DEF").setContent(new Intent(this, Support.class)));
        tabHost.addTab(tabHost.newTabSpec("tab1").setIndicator("GHI").setContent(new Intent(this, EmailActivity.class)));
        tabHost.addTab(tabHost.newTabSpec("tab2").setIndicator("TV Survey").setContent(new Intent(this, JKL.class)));

        tabHost.setCurrentTab(0);
    }
}
tabsactivity.xml

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


使用上面的layout_=“id/tabs”作为frameLayout

您能提供问题的屏幕截图吗?它可以让你更容易理解问题,因为你的标签内容在标签之上,这就是原因。试试下面我的答案