Boardy
Boardy

Reputation: 36205

Changing position of Android Action Bar

I am currently changing my android app so that it supports the action bar as stated by the android development guidelines.

I've successfully created the action bar and added, what were my menu buttons to the action bar. However, the action bar is being squished up at the top next to the program name icon and instead I want to show the action bar at the bottom of the screen.

Is there a way of changing the position of the action bar? I've tried doing a Google search and looking at the dev guide, but haven't found anything.

Thanks for any help you can provide.

Upvotes: 7

Views: 16428

Answers (6)

Curiousboy
Curiousboy

Reputation: 21

Actionbar is introduced in API level 11 (Android 3) and since then, the apps using the default theme (Holo) include ActionBar. The actionbar is hardcoded to top just like AppBar. To achieve what you are trying to do now. Using Toolbar is recommended as it offers much more customization and flexibility.

You can refer this: How to add a toolbar in the bottom of the screen?

Upvotes: 0

Venkatraman
Venkatraman

Reputation: 99

android:uiOptions="splitActionBarWhenNarrow"

This option worked for me

Upvotes: 1

Booger
Booger

Reputation: 18725

The reason they don't want navigation at the bottom of the screen, is because they have the system navigation buttons there (Home, Menu, Search, and App Drawer).

On many phones these are soft buttons (no physical separation between buttons and screen). Therefore, if you encourage the user to click in that area, it is easy to "fat-finger", and launch out of your app (accidentally hitting the "Home" button for instance).

Of course, it is important to follow design standards, to make you app "fit" into the Android ecosystem, like the other posters suggested.

Upvotes: 1

Ankur Kumar
Ankur Kumar

Reputation: 972

You need to add this in the manifest for your activity, if there are action items more than that can be accomodated in the top action bar they will be shown at the bottom

uiOptions="splitActionBarWhenNarrow"

Upvotes: 0

Sagar Hatekar
Sagar Hatekar

Reputation: 8790

According to the Layout Considerations, the ActionBar is supposed to be at the top of the screen to consistently display the app "branding" and "prominent functions" of an app. For eg: Search, Logout, etc. The bottom part of the screen is meant to show Context Menu which typically is shown when you press the "Menu" key on the device.

However, take a look at "Layout Considerations for Split Action Bars" in the above link which shows the possibility of a bottom bar to display "actions".

Upvotes: 1

Brian Dupuis
Brian Dupuis

Reputation: 8176

Not really. And Google heavily frowns on action bars at the bottom of the screen. They will not feature your application if the action bar is anywhere but where they want it.

Upvotes: 3

Related Questions