PgmFreek
PgmFreek

Reputation: 6402

Changing the view in TabHost in Android

How Can i change the TabHost in android, so it should look same as UITabBarController in iPhone? ie view should be on the top of the TabHost,not at the bottom.

Upvotes: 0

Views: 601

Answers (1)

BFil
BFil

Reputation: 13096

Here's a sample layout code to have the tabs on the bottom of the screen:

<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>

Upvotes: 3

Related Questions