简单但动态生成的 iOS 流程图或流程图视图

发布于 2024-11-04 06:12:56 字数 651 浏览 7 评论 0原文

也许“流程图”或“流程图”甚至不是我正在寻找的正确术语,但它是我能想到的最好的类比。基本上,我试图找到一个库或类,允许在给定空间内动态创建(在代码中)连接的单元格/UIView。在代码中,您可以从视图中添加/删除有序单元格,它会相应地排列。通常,如果超级视图大小允许(即iPad),它会水平排列这些连接的单元格。如果空间有限(iPhone),它会在水平线上排列尽可能多的单元格,然后在下方水平继续其余单元格......类似于图形“自动换行”。

诚然,我怀疑是否有一个神奇的库可以完成所有这一切,但如果 SO 社区可以为我指出一些更好的术语和/或一些潜在的候选者,我将非常感激。

我看过 AQGridView 它是一个如此庞大的库,我相信它的编译大小有点过大+700 KB。 SSCollectionView 非常接近,但是您必须手动将单元格居中,并且它还不支持可变单元格高度/宽度。

为了让您更好地了解我的想象,这里有一张图片: 在此处输入图像描述

Perhaps "flow chart" or "process chart" isn't even the correct terminology for what I'm looking for, but it's the best analog I can come up with. Basically, I'm trying to find a library or class that allows for the dynamic creation (in code) of connected cells/UIViews within a given space. In code, you could add/delete ordered cells from the view and it will arrange accordingly. Normally, if the superview size permits (i.e. iPad), it would arrange these connected cells horizontally. If it's space constrained (iPhone), it would arrange as many cells as possible on one line horizontally, then continue the rest of the cells horizontally below ... akin to a graphical "word wrap".

Granted, I doubt there's a magical library that does all of this, but if the SO community can point me to some better terminology and/or some potential candidates to fork, I would be incredibly appreciative.

I've looked at AQGridView and it is such a vast library, I believe it's overkill with a compiled size of +700 Kb. SSCollectionView is really close, but you have to manually center cells and it doesn't yet support variable cell height/width.

To give you a better sense of what I'm imagining, here's a pic:
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烟火散人牵绊 2024-11-11 06:12:56

完毕。我必须自己编写,但它的工作原理就像我想要的那样。请随意在 GitHub 上分叉我的 AppendingFlowView 存储库。

  • 它是动态的(按需添加阶段)。
  • 它通过动画根据需要重新定向和调整单元格大小来响应主视图中的变化!
  • 它根据所需的单元格大小和单元格数量自动处理多行。

屏幕截图

Done. I had to write my own, but it works just like I wanted it to. Feel free to fork my AppendingFlowView repository at GitHub.

  • It's dynamic (add stages on demand).
  • It responds to changes in the master view by reorienting and resizing the cells as necessary with animation!
  • It handles multiple rows automatically, depending on the desired cell size and number of cells.

Screenshot

鱼忆七猫命九 2024-11-11 06:12:56

我创建了这个开源 ios-lib 来轻松创建图形或树并将其绘制在视图中。

请随时提出拉取请求:)

https://github.com/chikuba/JENTreeView

I created this open-source ios-lib to easily create a graph or tree and draw it in a view.

Please feel free to make pull requests :)

https://github.com/chikuba/JENTreeView

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文