开发者

How do you insert separators in something like an NSTableView?

I'd like to learn how to use some kind of collection separator, such as in this example from Interface Builder:

How do you insert separators in something like an NSTableView?

开发者_Go百科

I haven't seen anything about these online, but I don't think I'm searching with the right keywords. Can someone point me in a direction?


Your example from Interface Builder is actually no real separator, it's just a custom NSCell.

Real separators, like available on the iPhone, always stay on top until the whole subgroup has been scrolled through. I hope you understand what i mean :)

To accomplish this, just create a custom cell. Make the cell look like this 'separator' and insert it at the appropriate index.

This might help understanding custom cells:

http://www.martinkahr.com/2007/05/04/nscell-image-and-text-sample/


A great example is Paul Kim's NoodleStickyRowTableView, now part of NoodleKit. This in addition gives you the iPhone-like behavior of the separator "sticking" at the top of the table.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜