-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Trying to add menuitem with image and having no label in it.
<borderlayout>
<north>
<menubar>
<menuitem image="/test/image.gif" onClick="@command('doSomething')"/>
<menuitem />
</menubar>
</north>
..
..
</borderlayout>
if i add a image without any label it cuts the image from both sides(right and bottom) ,and if i use some text in label the full image is shown ,
my problem is i have to show a menuitem with only image on it and no text. I can't change the size of image.
The following code works but i don't want to add label
<borderlayout>
<north>
<menubar>
<menuitem label="a" image="/test/image.gif" onClick="@command('doSomething')"/>
<menuitem />
</menubar>
</north>
..
..
</borderlayout>
does anybody know how to do it?
Specify custom-attributes org.zkoss.zul.image.preload to make sure the image is loaded then render the menu item.
<menubar>
<custom-attributes org.zkoss.zul.image.preload="true" />
<meunitem image="/test/image.gif" />
</menubar>
EDIT
The image is added as an background-image of HTML element. Therefore, you have to override the style and assign the size of the image to the correspond HTML element.
<style>
.z-menuitem-btn {
width: 16px !important;
height: 16px;
}
</style>
Asked: 2013-03-14 12:21:18 +0800
Seen: 143 times
Last updated: Mar 19 '13
can somebody give the use of imagecontent in menuitem ? [closed]
label in org.zkoss.zul.Messagebox must be middle aligned [closed]
Grid with frozen column shows unnecessary scrollbar
Component with independents columns
ZK ComboBox constraint firing on getSelectIndex()
Problems with visible/invisible grids using flex
A container should have a disable attribute.
Video inside: Processing... not translated to set org.zkoss.web.preferred.locale in zk.xml
enhancement needed in scrolling tab in tabbox using javacode