面板框中的文本被截断 (ZK/HTML)

Text cut off in panel box (ZK/HTML)

我在使用 ZK(大致类似于 HTML)进行某些格式化时遇到了一些麻烦。我使用的程序会自动将文本添加到标题为 "privDesc" 的框中。通常这工作正常——它通常把它放在一行上,如果需要的话更多。但是,对于特定长度的字符串(比如 71-73 个字符),文本会在末尾被截断,因为它不会滚动到下一行。我已经尝试更改相关 hbox 的 hbox-width,但没有成功。有人有什么想法吗?

<zk>
<window id="X" use="X" border="none" width="500px" height="650px" mode="overlapped" closable="true" position="center,center">
    <include src="X"/>
    <vbox style= "margin-left: 18px;margin-top:18px;margin-right:20px;height:210px;" >
        <label value="Add an access rule" style="font-size:28px !important;color:#0018A8" />
        <label style="color: #666666 !important;font-size:13px !important;" value="X"/>
        <separator spacing="15px" />
        <hbox spacing="0">
            <cell   style="valign=center;border-right: none;border-left: none;border-bottom: none;border-top: none"  width="200px">
                <label style="color: #666666 !important" value="X"/>
            </cell>
            <cell  style=";border-right: none;border-left: none;border-bottom: none;border-top: none"  width="230px">
                <combobox id="comboBoxPriv" width="230px" style="background: #FFFFFF;" readonly="true"/>
            </cell>
        </hbox>
        <panel height="30px" width="500px">
            <panelchildren style="margin-left: 18px; margin-right: 40px; width">
                <hbox width="325px" pack="center" align="center"><label id="privDesc"/></hbox>
            </panelchildren>
        </panel>

您可以像这样更改 panel 部分:

<panel height="min" width="500px">
    <panelchildren style="margin-left: 18px; margin-right: 40px; width">
        <hbox width="325px" pack="center" align="center">
            <label id="privDesc" hyphen="true"/>
        </hbox>
    </panelchildren>
</panel>

首先,标签现在有 属性 hyphen="true" 这使得当标签的值太长时它会显示在多行中(但只有当你在值,如果不是则不拆分)

其次,您的第一个面板有 属性 height="min",那是因为如果您输入一个固定值(如 height="30px"),那么当标签以多行显示时,它是剪切,但使用 height="min" 标签可以很好地显示,面板只需要多少就拿多少。