Tabhost默认的布局文件
- <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" >
- <LinearLayout
- android:orientation="vertical"
- android:gravity="bottom"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent" >
- <TabWidget
- android:id="@android:id/tabs"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content" />
- <FrameLayout
- android:id="@android:id/tabcontent"
- android:layout_width="fill_parent"
- android:layout_height="200dip" >
- </FrameLayout>
- </LinearLayout>
- </TabHost>
移到屏幕底部
- TabWidget tabWidget = tabHost.getTabWidget();
- LinearLayout lLayout = (LinearLayout) tabHost.getChildAt(0);
- lLayout.removeViewAt(0);
- lLayout.addView(tabWidget);
本文详细介绍了如何在Android应用中使用TabHost组件,包括其默认布局配置及将TabWidget移动到屏幕底部的方法。
123

被折叠的 条评论
为什么被折叠?



