问题描述
我是新的mac应用程序开发,这里我想在我的自定义视图(NSView)中展开和折叠视图
这里的示例图像
>
如何在NSViewController中实现这种类型的折叠和展开单元格,而不是在NSWindow ...
是否可以使用NSTableView?
我知道这是一个简单的问题,但我面临的问题。
请给我建议一些示例代码或链接..
感谢
折叠/展开可以通过调整自动布局约束
@property(nonatomic,weak)IBOutlet NSLayoutConstraint * moreInfoBoxHeight;
[[self.moreInfoBoxHeight animator] setConstant:75];
Apple使用NSStackView在 p>
I am new to mac application development, here i want to do expand and collapse view in my custom view(NSView)
here the sample image
How can i achieve these kind of collapse and expand cell in NSViewController not in NSWindow...
Is it possible using NSTableView?
I know its a simple question but i facing problem.
Please suggest me some sample code or links..
Thanks
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
这篇关于如何做崩溃和扩展视图在Mac应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!