Android 选项卡顶部的布局
我想我有一个简单的问题 我正在使用选项卡,我的xml代码是: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
<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
下