How to put Action Mode on top?

Asked

Viewed 211 times

1

I am using this property in manifest.xml:

android:uiOptions="splitActionBarWhenNarrow"

1- The options menu appears at the bottom, following the figure below:

inserir a descrição da imagem aqui

2-And when a click occurs on an item, the action mode appears below:

inserir a descrição da imagem aqui

I would like to keep the first figure(menu at the bottom) and just change the second figure that instead of the action mode appear below, appear on top equal in this image:

inserir a descrição da imagem aqui

Perhaps this is not possible, so I would like the action mode looked like this:

inserir a descrição da imagem aqui

  • How are you putting the showAsAction in your menu items? Could you include the xml that is inflating in Action Mode?

  • posted the sml of the items

  • I think by not having space he is forcing the Action Bar to go to the bottom. I could test put showAsAction="never" in the @+id/adicionar, only as a test.

  • this is the same thing... the @Wakim business is to make the action mode stay up and the menu stay down but by the property of the manifest.xml it always makes the two stay at the bottom...

  • https://developer.android.com/training/basics/actionbar/overlaying.html

  • @Wakim from what I’m reading I don’t think it’s possible to do this..

  • It’s... I think too, I believed it was for lack of space... But if even with space he didn’t leave it up there...

  • @Wakim I posted a second alternative to the action mode right after the menu bar.. in my last photo how to do?

  • 1

    No, you can’t change the position of ActionMode, that I know of... is using the appcompat right? You’ve already seen the Toolbar? I guess using him, you can do what you want.

  • @Wakim am using yes.. Toolbar not seen yet...

  • 1

    So the Toolbar is a "substitute" for ActionBar that came from Android Lollipop, you need to include it in your layout using the appcompat v21 (can be at the bottom) and can remove the attribute splitActionBarWhenNarrow. TheActionMode It’s not related to him, so he’s on top. More details on: http://android-developers.blogspot.com.br/2014/10/appcompat-v21-material-design-for-pre.html.

  • @Wakim I’ll take a look vlw

  • @Wakim ta kind of complicated I have all the support libraries and still not able to use Toolbar.. no layout appears an error The following classes could not be found: -android.support.v7.widget.Toolbar

  • How’s your build.gradle?

  • @Wakim never used it... what good is it?

  • @Wakim now that I remembered on the link that you had passed had a line .. Compile "com.android.support:appcompat-v7:21.0.+"

Show 11 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.