I am developing a small Android application in which I use the action bar with some menu items. One menu item contains submenus. Now I want to display a menu item with text and an icon always.
I define the menu items as follows.
<menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/card_menu" android:icon="@drawable/abc" android:showAsAction="withText|always" android:title="cards"> <menu> <item android:id="@+id/C1" android:title="C1"/> <item android:id="@+id/C2" android:title="c2"/> <item android:id="@+id/C3" android:title="C3"/> </menu> </item> <item android:id="@+id/notification" android:actionLayout="@layout/notification_icon" android:icon="@drawable/notification" android:showAsAction="always" android:title="Notifications"/> <item android:id="@+id/filter" android:icon="@drawable/filter" android:showAsAction="always" android:title="Filter"/> </menu>
Now what happens, my action bar displays my items correctly; The only thing is that when the window is in portrait mode, it displays only the image, and when the window is in landscape mode, it displays the image and text. But I want image and text in both modes.
How to do it? Is there any way to solve this?
android android-actionbar menu submenu
nilkash Feb 18 '13 at 8:34 2013-02-18 08:34
source share