I agree before-hand with anyone who wants to make the argument that tabs should be at the top of the screen, but I can't control the requirements for my app :) . I have to build an app with tabs at the bottom of the screen. I'm using SDK 14 and Actionbars. Is this even possible? I have already built a layout with the tabs at the bottom, but when I add the tabs to the ActionBar, they are automatically rendered at the top of the screen.
Any ideas would be really appreciated, and thank you all for taking the time to read this post.
If you want to hide Action Bar from the entire application (from all Activities and fragments), then you can use this method. Just go to res -> values -> styles. xml and change the base application to “Theme. AppCompat.
Android ActionBar is a menu bar that runs across the top of the activity screen in android. Android ActionBar can contain menu items which become visible when the user clicks the “menu” button.
All action buttons and other items available in the action overflow are defined in an XML menu resource. To add actions to the action bar, create a new XML file in your project's res/menu/ directory. The app:showAsAction attribute specifies whether the action should be shown as a button on the app bar.
You can use Tabhost for requirement,and inside tab.xml you can write below code . This will work fine .
<?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">
<RelativeLayout 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="fill_parent"
android:layout_weight="1" >
</FrameLayout>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:tabStripEnabled="false"
android:layout_alignBottom="@android:id/tabcontent"
android:background="#000000" />
</RelativeLayout>
</TabHost>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With