nssplitview

Trouble With NSSplitView Starting Sizes (Storyboards and Swift)

孤人 提交于 2019-11-30 07:29:09
I just started a simple Cocoa app using Swift, Storyboards, and a Document. The only change I've made is to replace the default View Controller in Main.storyboard with a Split View Controller. Everything works great as far as the subviews populating correctly except for one thing: the divider is always at the far left of the window when I start the app. This is with a vertical Split View. (If I change to horizontal the divider starts at the very top.) I have tried adding constraints but IB won't even allow me to add constraints to anything except content within the subviews. I've also tried

Trouble With NSSplitView Starting Sizes (Storyboards and Swift)

人走茶凉 提交于 2019-11-29 09:43:34
问题 I just started a simple Cocoa app using Swift, Storyboards, and a Document. The only change I've made is to replace the default View Controller in Main.storyboard with a Split View Controller. Everything works great as far as the subviews populating correctly except for one thing: the divider is always at the far left of the window when I start the app. This is with a vertical Split View. (If I change to horizontal the divider starts at the very top.) I have tried adding constraints but IB

How to expand and collapse NSSplitView subviews with animation?

好久不见. 提交于 2019-11-28 17:15:11
问题 Is it possible to animate the collapsing and expanding of NSSplitView subviews? (I am aware of the availability of alternative classes, but would prefer using NSSplitView over having animations.) I am using the method - (void)setPosition:(CGFloat)position ofDividerAtIndex:(NSInteger)dividerIndex to perform the collapsing and expanding. 回答1: After some more trying, I found the answer: yes, it's possible. The code below shows how it can be done. The splitView is the NSSplitView which is