cocoa — getting nested NSViews and CALayers to resize proportionally
问题 My NSWindow's contentView is an NSView subclass. It has some other NSView subclasses as subviews. The subviews are layer-based, and those layers in turn contain sublayers. Some of the sublayers have further sub-sublayers. I want the whole thing to resize proportionally when the window is resized. What is the right way to set it up so that will happen? Thanks EDIT: I am not using Interface Builder at all. 回答1: Here's what I've done to get the contents of an NSView to scale proportionally as I