开发者

best practice for creating repeating cocoa UI element groups

Anyone have any examples of methods for creating a UI with multiple (one or more) lines (groups) of UI elements? There will be at least two different "groups" of elements (labels, text fields, check boxes, etc), but there will be common columns (headers). The number of rows (line开发者_开发技巧s) of elements is determined at run-time - there will be at least one, and possibly up to a dozen.

I'm sure I'll have to resize the containing window in some cases. I think the typical case will be two or three lines, and the base layout will be sized for that.

I'm sure I could do it all in direct code, but I'm wondering if there's some interface builder magic that would make this easier.

Thanks!


Sounds like a case for NSTableView to me. You can use different kinds of cells besides text cells, such as checkbox cells, popup menu cells, etc. If you need to use a UI element that isn't available in cell form, write your own subclass of NSCell to do it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜