I set actionLayout to a menu item and set the background color and image, but this is not respected. In my activity I:
getMenuInflater().inflate(R.menu.submit_action, menu);
my submit_action:
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/action_submit" android:actionLayout="@layout/check" app:showAsAction="always" /> </menu>
my layout check
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" style="?android:attr/actionButtonStyle" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#e8e8e8" android:clickable="true" android:contentDescription="lol" > <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@null" android:scaleType="centerInside" android:src="@drawable/ic_action_tick" /> </RelativeLayout>
but even with all this setting it looks like an action bar that does not display my menu item at all (but it is there because it responds to a click, but does not appear):

android android-actionbar android-menu
tipu Apr 22 '14 at 6:14 2014-04-22 06:14
source share