Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/196.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中更改TabHost中的视图_Android_Android Tabhost - Fatal编程技术网

在Android中更改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

如何在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"
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>