0

I'm currently creating an app where it would be useful for the user to have all the options in the actionbar.

This is the current situation:

As you can see, Item1 and Item2 are on the right but I'd like to have these on the left side. Is this possible?

If it is not possible, how would I simulate what I want? An ImageView with Buttons functioning as the ActionBar?

tshepang
  • 12,111
  • 21
  • 91
  • 136
James
  • 1,036
  • 1
  • 8
  • 24
  • 1
    That would be horribly confusing for the user... Like a car maker that would like to change the position of the seats, mirrors and driving wheel.. Please reconsider your needs, but yes, that might be possible with a custom layout – Waza_Be May 08 '13 at 17:29
  • http://stackoverflow.com/questions/7454102/how-to-align-items-in-action-bar-to-the-left Google is your friend :) – Johannes May 08 '13 at 17:30
  • @Waza_Be Hmm you are kind of right, though it is for a drawing app. So the user could choose between pencil/eraser/line-tool etc etc. Would be quite useful if all these tools were at the top. I could make my own custom action-bar and place it at the left side I guess. – James May 13 '13 at 15:46

1 Answers1

0

I had a similar issue but I wanted something on the left, something in the middle, and overflow on the right. I created a custom layout with three ImageButtons for the three elements. Then used an <include> tag to include this layout in my Activities xml files.

I also created a BaseActivity for my other Activities to extend and put the menu functionality in there like OnMenuItemClickListener() then I could just override them in my Activities if I needed different functionality for a certain Activity aside from what it did in the BaseActivity. I also used PopupMenu here (requires API >= 11).

tshepang
  • 12,111
  • 21
  • 91
  • 136
codeMagic
  • 44,549
  • 13
  • 77
  • 93