How can I create an android menu item using android setting icon

后端 未结 4 2008
天涯浪人
天涯浪人 2020-12-23 20:12

Can you please tell me how can I create an android menu item using android setting icon?

4条回答
  •  时光说笑
    2020-12-23 20:27

    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);
    

    You can also set it in your xml layout like this:

    
    
    • Creating Menus in Android

提交回复
热议问题