zl程序教程

您现在的位置是:首页 >  移动开发

当前栏目

android选项卡(TabHost)如何放置在屏幕的底部

Android 如何 屏幕 底部 选项卡 放置 TabHost
2023-06-13 09:14:43 时间
今天写Tab的时候由于TAB的跳转问题去查资料,倒反而发现更有趣的问题,就是如何将TAB放置在屏幕的底端。
复制代码代码如下:

<?xmlversion="1.0"encoding="utf-8"?>
<TabHostxmlns: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:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:padding="5dp"/>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</TabHost>