android - How to add icon into option menu? -
i try add icon option menu in app. add icon attribute items icons don't show.
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/exit" android:icon="@drawable/abc_ic_go" android:title="@string/exit"/> <item android:id="@+id/about_us" android:title="@string/about_us"/> <item android:id="@+id/help" android:icon="@drawable/abc_ic_go" android:title="@string/help"/> <item android:id="@+id/setting" android:icon="@drawable/abc_ic_go" android:title="@string/setting"/> <item android:id="@+id/search_collection" android:icon="@drawable/search" android:title="@string/search" app:actionviewclass="android.support.v7.widget.searchview" app:showasaction="always"/> </menu>
i want menu image.
use android:showasaction="always|withtext"
in items
<item android:id="@+id/help" android:icon="@drawable/abc_ic_go" android:showasaction="always|withtext" android:title="@string/help"/>
Comments
Post a Comment