Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 选项卡顶部的布局_Android_Android Tabhost_Android Xml - Fatal编程技术网

Android 选项卡顶部的布局

Android 选项卡顶部的布局,android,android-tabhost,android-xml,Android,Android Tabhost,Android Xml,我想我有一个简单的问题 我正在使用选项卡,我的xml代码是: <TabHost android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/tabHost" xmlns:android="http://schemas.android.com/apk/res/android" > <TabWidget android:layout_width="fill_paren

我想我有一个简单的问题

我正在使用选项卡,我的xml代码是:

<TabHost android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/tabHost"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<TabWidget
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@android:id/tabs"
/>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@android:id/tabcontent"
>
    <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/tab1"
    android:orientation="vertical"
    android:paddingTop="100px"
    >
    <TextView 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    android:id="@+id/teste" />
    </LinearLayout>
    <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/tab2"
    android:orientation="vertical"
    android:paddingTop="60px"
    >
    </LinearLayout> 
    <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/tab3"
    android:orientation="vertical"
    android:paddingTop="60px"
    >
    </LinearLayout>
</FrameLayout>
</TabHost>

问题是,如果我删除顶部填充,当我打开一个选项卡时,该选项卡的内容在其上方


这样做不会给我带来麻烦吗?内容怎么可能不在其上方呢?

尝试将
选项卡小部件
框架布局
放在垂直
线性布局
中。这将强制
FrameLayout
位于
TabWidget