How to do collapse and expand view in mac application?

…衆ロ難τιáo~ 提交于 2019-12-07 22:43:27

Collapsing / expanding can be implemented by adjusting auto layout constraints in the action method of the disclosure triangle button.

@property (nonatomic, weak) IBOutlet NSLayoutConstraint *moreInfoBoxHeight;

[[self.moreInfoBoxHeight animator] setConstant:75];

Apple has sample code using NSStackView at https://developer.apple.com/library/mac/samplecode/InfoBarStackView/Introduction/Intro.html

The view at the picture given is NSOutlineView. It is the NSTableView subclass.

Look at the Apple reference page and Outline programming topics.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!