Hello Cocoaphiles, ;) I've just started experimenting with NSStackView, and I'm having a very interesting problem which I can't solve. I've scoured the auto layout guides on Apple's website as well as the NSStackViewdocumentation, and can't seem to find anything.
My problem is that I have two identical NSScrollView objects (each with an embedded NSTextView) which are loaded from nib files. When I add these views to my stack view, the one that is added first takes up 100% of the available space, and the second collapses completely down to the bottom with a height of 2 pixels while taking up all available horizontal space. In effect, this looks like the first view is the only one in the window. Here's what it currently looks like: http://i.stack.imgur.com/2tEwm.png It's nearly impossible to see in this example because of the background color, but the scroll view ends a couple pixels above the bottom of the window. Here's a better view from the view hierarchy inspector, where I have this 2 pixel high view selected: http://i.stack.imgur.com/XJeG5.png Here's the relevant setup code: // Load the stack view self.inputViewController = [[NSViewController alloc] initWithNibName:@"Document_TextInputView" bundle:nil]; self.textView = (NSTextView *)[[(NSScrollView *)self.inputViewController.view contentView] documentView]; self.outputViewController = [[NSViewController alloc] initWithNibName:@"Document_TextOutputView" bundle:nil]; self.outputView = (NSTextView *)[[(NSScrollView *)self.outputViewController.view contentView] documentView]; // Add all views into the stack view [self.stackView addView:self.inputViewController.view inGravity:NSStackViewGravityTop]; [self.stackView addView:self.outputViewController.view inGravity:NSStackViewGravityBottom]; self.stackView.orientation = NSUserInterfaceLayoutOrientationVertical; // Load the text into the window. [self.textView setString:self.cachedText]; [self.outputView setString:@"=== PROGRAM OUTPUT ===\n"]; [self.codeActionSegmentedControl setEnabled:NO forSegment:1]; From what I understand, the intrinsic content size should prohibit the view from getting shrunk this small. I'm not too familiar with NSStackView, so any help would be appreciated. Thanks a lot, — SevenBits
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com