开发者

How do you insert separators in something like an NSTableView?

开发者 https://www.devze.com 2023-02-11 04:34 出处:网络
I\'d like to learn how to use some kind of collection separator, such as in this example from Interface Builder:

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

精彩评论

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