Why the pictures/icon don't show up in the menu?

后端 未结 2 1033
醉梦人生
醉梦人生 2021-01-15 12:24

I followed this tutorial to create a menu

but my menu looks differently:

\"menu\"

How can I cre

相关标签:
2条回答
  • 2021-01-15 12:40

    If you use some following attribute in manifest file then it's will be show your icon....

    <activity android:name=".ui.CategoryActivity"
            android:label="@string/app_name"
            **android:theme="@android:style/Theme.NoTitleBar"**></activity>
    

    It's work fine for me...:)

    **must be enter.

    0 讨论(0)
  • 2021-01-15 12:59

    First of all I want to say : Say Goodbye to the Menu Button

    Your code have no problem, and it should be showing the icons if the drawables are there in correct folder,Working fine on Android 2.2.

    The Menu features says :

       1.  Context menus: Do not support item shortcuts and item icons.
       2. Options menus: The icon menus do not support item check marks and only show the item's condensed title. The expanded menus (only available if six or more menu items are visible, reached via the 'More' item in the icon menu) do not show item icons, and item check marks are discouraged.
       3. Sub menus: Do not support item icons, or nested sub menus. 
    

    No problem with your code, Problem may be with the API level you are using, but still want to suggest that don't use Menu anymore.


    Android no longer requires a dedicated Menu button, some devices don’t have one, and you should migrate away from using it.

    0 讨论(0)
提交回复
热议问题