Cocoa Interface Builder's 'Attributes Insp

2019-02-19 03:53发布

I'm making a Cocoa application, and I would like a panel like the 'Attributes Inspector' in Interface Builder. So with big tabs on the top and collapsable/expandable groups. Does anyone know how I can do this?

This is an image of the Attributes Inspector:

Attributes Inspector http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeQuickTour/Art/hello_win_attributes.jpg

So I actually want to make a window like the one shown in the image above.

3条回答
Fickle 薄情
2楼-- · 2019-02-19 04:25

There's no built-in Cocoa controls to do this. You're going to have to write some custom views which replicate the functionality.

There some good advice for creating custom controls in the answers to this question: Looking for info on custom drawing of interface components (Cocoa)

If you need additional help, I recommend you ask smaller, more specific questions explaining what you've tried and what hasn't worked.

查看更多
Emotional °昔
3楼-- · 2019-02-19 04:30

InspectorKit is FOSS on github.

查看更多
爷的心禁止访问
4楼-- · 2019-02-19 04:42

I've written some custom classes to do this- it ended up being less work than I expected. I broke it down into two separate components which can be used independently- the first handles the icons at the top and performs the view switching and the second handles the expandable panes: ViewSelectorBar InspectorPanel

My code is available at github and is under the BSD 2-clause license.

查看更多
登录 后发表回答