微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

draw.io 如何将容器元素设置为可垂直滚动

如何解决draw.io 如何将容器元素设置为可垂直滚动

我目前可以将侧边栏中的容器元素添加到我的图表中,并将文本拖放到容器中,其中添加到容器中的每个文本行都成为一个单独的可选元素。

我希望,当我将更多的文本行拖放到容器中时,容器可以显示,而不是将容器切换为垂直滚动,而不是调整容器大小以容纳额外的文本行。

有没有办法做到这一点?

解决方法

您需要编辑 html 文本(双击块内的文本并单击按钮 >)并添加带有样式的 div 包装器 <div style="height: 100px ; overflow: scroll"> 继续您需要编辑块的样式并添加 overflow=fill

,

创建一个新文档,然后转到Extras -> Edit Diagram...

enter image description here

用这个替换对话框的内容:

<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="&lt;div style=&quot;overflow-y: auto; height: 200px &quot; class=&quot;s-prose js-post-body&quot; itemprop=&quot;text&quot;&gt;&lt;br/&gt;                &lt;br/&gt;&lt;p&gt;I can currently add a container element from the sidebar to my &lt;br/&gt;diagram and drag and drop text to the container,where each text line &lt;br/&gt;added to the container becomes a separately selectable element.&lt;/p&gt;&lt;br/&gt;&lt;p&gt;I want,when I drag and drop more text lines to the container than &lt;br/&gt;the container can display,is the container to switch to being &lt;br/&gt;vertically scrollable instead of the container resizing to accommodate &lt;br/&gt;the additional text lines.&lt;/p&gt;&lt;br/&gt;&lt;p&gt;Is there a way to accomplish this?&lt;/p&gt;&lt;br/&gt;    &lt;/div&gt;&lt;div class=&quot;s-prose js-post-body&quot; itemprop=&quot;text&quot;&gt;&lt;br&gt;&lt;/div&gt;" 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=&quot;overflow-y: auto; height: 200px &quot;

你会得到这样的东西:

enter image description here

然后你可以复制块。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。