Android 操作栏不显示图标

Android Action bar not showing Icons

如何在操作栏中显示图标,这是我的代码,

<?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>

@Override
public boolean onCreateOptionsMenu(Menu menu){
    MenuInflater mif = getMenuInflater();
    mif.inflate(R.menu.custom_action_bar,menu);
    return super.onCreateOptionsMenu(menu);
}

感谢您的帮助!

如果使用应用程序兼容性,请使用 app:showAsAction

<item android:id="@+id/search_icon"
    android:icon="@drawable/ic_action_search"
    app:showAsAction="always"
    android:orderInCategory="100"
    android:title="Search" >
</item>

在Manifest.xml文件中

    <activity android:name="your activity name"
        android:theme="@style/Theme.Holo.Light"></activity>