问题描述
我目前可以将侧边栏中的容器元素添加到我的图表中,并将文本拖放到容器中,其中添加到容器中的每个文本行都成为一个单独的可选元素。
我希望,当我将更多的文本行拖放到容器中时,容器可以显示,而不是将容器切换为垂直滚动,而不是调整容器大小以容纳额外的文本行。
有没有办法做到这一点?
解决方法
您需要编辑 html 文本(双击块内的文本并单击按钮 >)并添加带有样式的 div 包装器
<div style="height: 100px ; overflow: scroll">
继续您需要编辑块的样式并添加
overflow=fill
创建一个新文档,然后转到Extras -> Edit Diagram...
:
用这个替换对话框的内容:
<mxGraphModel dx="942" dy="546" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="hHBZA0x96M1ugzBaWHee-3" value="<div style="overflow-y: auto; height: 200px " class="s-prose js-post-body" itemprop="text"><br/> <br/><p>I can currently add a container element from the sidebar to my <br/>diagram and drag and drop text to the container,where each text line <br/>added to the container becomes a separately selectable element.</p><br/><p>I want,when I drag and drop more text lines to the container than <br/>the container can display,is the container to switch to being <br/>vertically scrollable instead of the container resizing to accommodate <br/>the additional text lines.</p><br/><p>Is there a way to accomplish this?</p><br/> </div><div class="s-prose js-post-body" itemprop="text"><br></div>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;overflow: scroll;" parent="1" vertex="1">
<mxGeometry x="40" y="60" width="320" height="200" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
主要变化是:
style="overflow-y: auto; height: 200px "
你会得到这样的东西:
然后你可以复制块。