Completely baffled by NSTabViewController + Autolayout
Completely baffled by NSTabViewController + Autolayout
- Subject: Completely baffled by NSTabViewController + Autolayout
- From: Seth Willits <email@hidden>
- Date: Mon, 17 Aug 2015 21:13:47 -0700
I am missing something big, because I am having nothing but insane trouble when trying to get a simple tab view working with autolayout. Every path I head down has strange problems. I've tried slimming it down to the smallest test project and I'm still confused.
The problems I'm seeing are randomly positioned views and inconsistent sizing:
http://www.sethwillits.com/temp/TabViewResizing1.mp4
Here's the project:
http://www.sethwillits.com/temp/TabViewResizing.zip
The goal of this project as is, is simple: using an NSTabViewController, add multiple tab view items where each of the items has a view with its own autolayout-determined fixed size (as in, either an intrinsic content size, or the constraints of the subviews dictate the size of the view itself.) **That's it.** And I've been struggling with this for hours.
In the test project I have two tabs. Each has an NSView subclass that has an intrinsic size so that the view itself must always be at that size. Those views are then added to the tabview via tab view items. I expect that the layout system will resize the views to be at their intrinsic size, and position them properly within the tab view.
Instead I'm seeing them a) not always be at their intrinsic size, and b) if the tab switches in the middle of animating, then it stops at some interrupted size.
Can anyone explain this?
Bonus question:
How am I supposed to get a normal bordered tab view with tabs on top using an NSTabViewController? Using NSTabViewControllerTabStyleSegmentedControlOnTop shows the segmented control, but there's no border? Using NSTabViewControllerTabStyleUnspecified + tabView.tabViewType = NSTopTabsBezelBorder; is as close as I can get, but then the tab view item's view placement is wrong?
--
Seth Willits
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden