xml - Android Action bar not showing Icons -
how can display icons in actions bar, here code,
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/search_icon" android:icon="@drawable/ic_action_search" android:showasaction="always" android:orderincategory="0" android:title="search" > </item> </menu>
and
@override public boolean oncreateoptionsmenu(menu menu){ menuinflater mif = getmenuinflater(); mif.inflate(r.menu.custom_action_bar,menu); return super.oncreateoptionsmenu(menu); }
thanks !
if using app compat use app:showasaction
<item android:id="@+id/search_icon" android:icon="@drawable/ic_action_search" app:showasaction="always" android:orderincategory="100" android:title="search" > </item>
Comments
Post a Comment