标签:des android cWeb style blog http io color ar
1. Menu Resource
A menu resource defines an application menu (Options Menu, Context Menu, or submenu) that can be inflated with MenuInflater
.
//res/menu/example_menu.xml
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/item1" android:title="item1" android:showAsAction="ifRoom|withText"/> <item android:id="@+id/submenu" android:title="submenu_title" android:showAsAction="ifRoom|withText" > <menu> <item android:id="@+id/submenu_item1" android:title="submenu_item1" /> <item android:id= "@+id/submenu_item2" android:title="submenu_item2" /> </menu> </item> <group android:id="@+id/group"> <item android:id="@+id/group_item1" android:title="group_item1" /> <item android:id="@+id/group_item2" android:title="group_item2" /> </group> </menu>
public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.example_menu, menu); return true; }
Pay attention to the property "showAsAction"
When and how this item should appear as an action item in the Action Bar.
3.App Resources-Resource Types/Menu Resource
标签:des android cWeb style blog http io color ar
原文地址:http://www.cnblogs.com/iMirror/p/4071232.html