0

I followed a tutorial and i got the tabs i wanted but they are at the bottom of the screen.

Here is my main.xml:

<?xml version="1.0" encoding="utf-8"?>
<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: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" />

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0" />
    </LinearLayout>

</TabHost>

Whats wrong? Thanks

3
  • 1
    Try to put the TabWidget before the FrameLayout
    – talkol
    Jul 21, 2013 at 21:17
  • so much reserach with such a simple answer. thanks dude. works like a charm Jul 21, 2013 at 21:23
  • added an answer for it for future generations :)
    – talkol
    Jul 22, 2013 at 6:04

1 Answer 1

0

Try to put the TabWidget before the FrameLayout in your XML

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.