How can I insert an icon (png or gif) in a menu-item in xml menu ?

Former Member
Former Member

Hello,

I'm a beginner. I created an menu which consists in two items using an xml file but I don't know how to insert an icon (png for example) in my items.

I tried the following syntaxe : 

<menu id="MainMenu" title="@Strings.MainMenuTitle">

<menu-item id="Item1" label="@Strings.MenuLabel1" icon="cloud.png"/>
<menu-item id="Item2" label="@Strings.MenuLabel2" icon="cloud.png"/>
</menu>

But I get an error saying "Attribute 'icon' is not allowed to appear in element 'menu-item'".

Do you know another syntaxe to add an icon in my item ?

Thank you in advance for your precious collaboration.

Cordially.