你能告诉我,我怎么可以使用Android设置图标创建一个Android菜单项?
Can you please tell me how can I create an android menu item using android setting icon?
感谢你。
下面是一个列表标准图标的。我没有看到一个设置图标。也许你的意思是preferences( ic_menu_ preferences )?
Here is a list of the standard icons. I don't see a "settings" icon. Perhaps you mean "Preferences" (ic_menu_preferences
)?
您可以通过编程设置图标是这样的:
You can set the icon programmatically like this:
menu.add(0, MENU_QUIT, 0, "Quit").setIcon(R.drawable.menu_quit_icon);
您还可以将其设置在这样的XML布局:
You can also set it in your xml layout like this:
<item android:id="@+id/save_button"
android:icon="@android:drawable/ic_menu_save"
android:title="Save Image"/>
在Android中创建菜单
Creating Menus in Android