可以使用哪个控件来显示动态表单(具有各种类型的数据)?
我面临以下问题:
- 我们有项目的元数据,每个项目可以是不同类型的 NSControl,目前是 NSTokenField 和 NSTextField,但我们可能需要 NSCombo 或其他类型。 我需要构建一个表单,其中每个条目都有一个标签和一个可编辑控件。 由于项目是从服务器检索的,因此必须动态构建此表单。
我已经用 NSMatrix 实现了它,除了看起来很破旧之外,我还面临着一些我不知道如何解决的视觉问题。
视觉问题是每次我将鼠标移到 NSTextFieldCell 上时,标记都会绘制在 NSMatrix 表单的左上角。
现在,我正在考虑转向另一种类型的控件,
我用谷歌搜索了几个小时,找到了以下控件: NS表格, NSMatirx(NSForm 的父级), NSCollectionView, NSTableView
其中哪一个最适合这项任务?
我希望我很清楚,因为我想添加图片,但由于缺乏“信誉点”,它不允许我添加。
感谢您的帮助, 埃亚尔。
I'm facing the following problems:
- We have meta data for items, each item can be a different type of NSControl, currently NSTokenField and NSTextField, but we might need NSCombo or other types.
I need to build a form in which each entry will have a label and an editable control.
this form has to be built dynamically since the items are retrieved from the server.
I've implemented it with NSMatrix, and apart from it looking pretty shabby, I'm faced with some visual issues I don't know how to solve.
The visual issue is every time I move the mouse over the NSTextFieldCell the tokens get drawn on the top left corner of the NSMatrix form.
now, I'm considering moving to another type of control,
I've googled for few hours, and found the following controls:
NSForm,
NSMatirx (parent of NSForm),
NSCollectionView,
NSTableView
which one of these is the most appropriate for this task?
I hope I am clear since I wanted to add pictures, but it wouldn't let me due to lack of "reputation points".
Thanks for your help,
Eyal.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NSTokenField
是NSTextField
的子类,因此您可以使用NSTableView
来显示它们。您还可以绘制一个包含所有元素的自定义
NSCell
。当每个“项目”具有不同数量元素时,情况会变得更加复杂。NSTokenField
is a subclass ofNSTextField
so you could use anNSTableView
to display them.You could also draw a custom
NSCell
with all elements in it. When each "item" has a different number of elements then this becomes a bit more complicated though.