Action Bar menu is not shown in ActionBarActivity

来源:互联网 发布:明道软件优缺点 编辑:程序博客网 时间:2024/05/21 01:47

Your menu XML would need to look like this:

<menu xmlns:android="http://schemas.android.com/apk/res/android"      xmlns:yourapp="http://schemas.android.com/apk/res-auto" >    <item android:id="@+id/action_search"          android:icon="@drawable/ic_action_search"          android:title="@string/action_search"          yourapp:showAsAction="ifRoom"  />    ...</menu>

And you would need to use the same yourapp prefix for anything else related to the action bar (e.g., yourapp:actionLayout)


see document in Android Developer

原创粉丝点击