0

I'm trying to put the actionBar on my project at the bottom of the screen, I'm doing everything right, I guess..
Let's see..
The activity that will use both (actionbar at the top and bottom) is like this:

<activity
            android:name=".view.TabsFinanceiroActivity"
            android:label="@string/title_activity_tabs_financeiro"
            android:screenOrientation="portrait"
            android:uiOptions="splitActionBarWhenNarrow">
            <meta-data android:name="android.support.UI_OPTIONS"
                android:value="splitActionBarWhenNarrow" />
        </activity>

The actionBar on the top should only show the tilte and the Home button. And the actionBar on the bottom should show 2 TextViews.
But my actionBar doesn't appears on the bottom too..
My menu.xml has nothing, since I removed the items to do some tests, but nothing worked.
Can someone help me?

henrique romao
  • 560
  • 1
  • 8
  • 32

2 Answers2

1

If you want to place ActionBar at arbitrary position on screen, you should look into using Toolbar as ActionBar.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    ...

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_alignParentBottom="true"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/somecolor" />
    ...
</RelativeLayout>

And then in code :

Toolbar toolbar = (Toolbar) fullLayout.findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

You will need support appcompatv7 library

chiragjn
  • 764
  • 11
  • 31
0

Have a look at Toolbars to achieve this.

Devishankar
  • 194
  • 2
  • 16