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???
or just use a custom one from: http://code.google.com/p/androidtabs/
it allows tabs on the bottom
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:
Check this
The basic concept behind the
Tab-Activity
as followsTabHost
is a container for a tabbed window view. This object holds two children: a set of tab labels that the user clicks to select specific tab, and a FrameLayout object that displays the content of that page.The individual element are typically controlled using this container object, rather then setting values on the child elements themselves.
TabWidget
displays a list of tab labels representing each page in the parent's tab collection. The container object for this widget is TabHost. When a user selects a tab, this object sends a message to container, TabHost, to tell to switch the display page. The container TabHost is used to add labels, add the callback handler, and manage callbacks.so adjust your layout as follows -
this is the code for bottom tab
Please Check the following link
There are two ways to display tabs at the bottom of a tab activity.
1) Using relative layout 2) Using Layout_weight attribute
http://justkumar.blogspot.com/2011/09/tabs-at-bottom-of-tabactivity-by.html