Skip to content Skip to sidebar Skip to footer

Put Tabs In The Bottom Of Screen

I want to put tabs at the bottom part of my screen . For this purpose I have the following code : package info.androidhive.tabsswipe; import info.androidhive.tabsswipe.adapter.Tab

Solution 1:

Actually it's against Android Design Guideline since at bottom there are soft/hard buttons like back button home button etc.

http://developer.android.com/design/patterns/pure-android.html

But if you insist on to put them at the bottom, you can implement it like GitHub example consists tabs in bottom, using FragmentTabHost.

https://github.com/rameshkec85/BottomTabsFragmentTabHost

Solution 2:

These sample xml code defines move tab to bottom of the screen:

<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"android:orientation="vertical" ><TabHostandroid:id="@android:id/tabhost"android:layout_width="fill_parent"android:layout_height="fill_parent" ><RelativeLayoutandroid:layout_width="fill_parent"android:layout_height="fill_parent" ><FrameLayoutandroid:id="@android:id/tabcontent"android:layout_width="fill_parent"android:layout_height="fill_parent"android:layout_below="@android:id/tabs" ><FrameLayoutandroid:id="@+id/tab_home"android:layout_width="fill_parent"android:layout_height="fill_parent" /><FrameLayoutandroid:id="@+id/tab_video"android:layout_width="fill_parent"android:layout_height="fill_parent" /><FrameLayoutandroid:id="@+id/tab_audio"android:layout_width="fill_parent"android:layout_height="fill_parent" ></FrameLayout><FrameLayoutandroid:id="@+id/tab_blog"android:layout_width="fill_parent"android:layout_height="fill_parent" ></FrameLayout><FrameLayoutandroid:id="@+id/tab_gal"android:layout_width="fill_parent"android:layout_height="fill_parent" ></FrameLayout><FrameLayoutandroid:id="@+id/tab_more"android:layout_width="fill_parent"android:layout_height="fill_parent" ></FrameLayout></FrameLayout><TabWidgetandroid:id="@android:id/tabs"android:layout_width="fill_parent"android:layout_height="wrap_content"android:layout_alignParentBottom="true"  //alignparentbottommainlyusedformovethetabtobottomofthescreen.android:background="@drawable/ic_launcher"android:divider="@null" /><!-- android:background="#d8e49c" --></RelativeLayout></TabHost></LinearLayout>

Solution 3:

with an action bar you will only be able to add tabs at the top, since that is the way android apps should look like. Having tabs at the bottom is purely ios style. and if you still wish to achieve the same look at :

this. Github source can be found here

Solution 4:

Don't do this, tabs should always be at the top in Android.

Solution 5:

one more solution: https://stackoverflow.com/a/23150258/2765497 for support api<11 replace TabView to FragmentTabVeiw and add enother imports from Sherlock of Support library

Post a Comment for "Put Tabs In The Bottom Of Screen"