How to align menu item text in Actionbar overflow

2019-02-25 15:06发布

问题:

I'm using ActionBarSherlock to implement an actionbar in my Android application. Menu options that don't fit on this actionbar are automatically added to the overflow menu. The problem I'm facing is that these menu options have center alignment:

How do I make sure that the menu items in the overflow menu are right-aligned, like for example in the Gmail application?

Thanks.

回答1:

Never mind, I found the cause.

It turns out I was styling TextView somewhere in my theme with

<item name="android:gravity">center_horizontal</item>

and this also affected the menu items.