views:

1442

answers:

4

hi all,

i am working on tabactivity.

i wanna show my tabwidget below the tabcontent(framelayout).

i done it by setting the tabwiget tab attribute as

android:gravity="bottom"

but the framelayout cant align with those tabs.

that is the tabs are shown at the bottom of the screen and overlap the framelayout

how to do that? if set some height value to the framelayout it not optimized for all screens of android. what can i do? any idea???

A: 

Android's examples to the rescue!

http://developer.android.com/resources/tutorials/views/hello-tabwidget.html

Just swap tabcontent and tabs in res/layout/main.xml:

   <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="5dp">
   <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:padding="5dp" />        
   <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" />

   </LinearLayout>
Ralphleon
two thinks i have to tell u.1. its not work unless u set the gravity for ur tabwidget.2. when the framelayout content's height i larger than the screen height the tabwidget lose its visibility from ur screen.please try ur example and let me know.
Praveen Chandrasekaran
+1  A: 

or just use a custom one from: http://code.google.com/p/androidtabs/

it allows tabs on the bottom

Reflog
A: 

As this question is a duplicate, I will simply link to my full answer on the other question.

http://stackoverflow.com/questions/2395661/android-tabs-at-the-bottom/2710404#2710404

stormin986
A: 

I post a solution on the other question:

http://stackoverflow.com/questions/2395661/android-tabs-at-the-bottom/3533787#3533787

Hope it helps :)

Leaudro