在Android中更改TabHost中的视图
如何在android中更改TabHost,使其看起来与iPhone中的UITabBarController相同?ie视图应位于TabHost的顶部,而不是底部。以下是一个示例布局代码,用于将选项卡置于屏幕底部:在Android中更改TabHost中的视图,android,android-tabhost,Android,Android Tabhost,如何在android中更改TabHost,使其看起来与iPhone中的UITabBarController相同?ie视图应位于TabHost的顶部,而不是底部。以下是一个示例布局代码,用于将选项卡置于屏幕底部: <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" andro
<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:layout_width="fill_parent" android:layout_height="fill_parent">
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="1">
</FrameLayout>
<TabWidget android:id="@android:id/tabs"
android:layout_width="fill_parent" android:layout_height="65dp"
android:layout_marginLeft="0dip" android:layout_marginRight="0dip"
android:layout_weight="0"></TabWidget>
</LinearLayout>
</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:layout_width="fill_parent" android:layout_height="fill_parent">
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="1">
</FrameLayout>
<TabWidget android:id="@android:id/tabs"
android:layout_width="fill_parent" android:layout_height="65dp"
android:layout_marginLeft="0dip" android:layout_marginRight="0dip"
android:layout_weight="0"></TabWidget>
</LinearLayout>
</TabHost>