I'm trying to add a collapsible panel to a panel I added in the Interface Builder, similar to the one found in Office 2008 and XCode itself.
This is the collaps开发者_StackOverflow社区ible panel for those that don't know it:
OS X collapsible panel http://grab.by/3Hqv
Any idea how I can add this to my project? Google hasn't been of much help.
This is most often referred to as a "disclosure view" or "disclosure panel" and usually has to come with an intelligent container view (that grows/shrinks/scrolls correctly with multiple disclosure subviews). There is no such control as part of the API. Most developers roll their own while some use third-party open source.
The Omni Frameworks have one such control that works very well (including "tear-off" panels, etc., if I recall correctly). The drawback: it's a large framework and has a lot of other stuff in it as well.
InspectorKit is another. It's more focused (just the control itself and an IB plugin), but the last incarnation I tested did have a few UI issues with the Interface Builder plugin.
I've also written a framework for handling this: SFBInspectors
精彩评论