Re: Why is translatesAutoresizingMaskIntoConstraints on in my storyboard?
Re: Why is translatesAutoresizingMaskIntoConstraints on in my storyboard?
- Subject: Re: Why is translatesAutoresizingMaskIntoConstraints on in my storyboard?
- From: Kevin Cathey <email@hidden>
- Date: Wed, 04 Sep 2013 09:27:12 -0700
All top level views in XIBs and storyboards have translatesAutoresizingMaskIntoConstraints=YES. This is because most UIKit and AppKit view and controller subclasses are not yet using constraints to layout, so the default of translatesAutoresizingMaskIntoConstraints=YES is least unexpected.
As Kyle pointed out translatesAutoresizingMaskIntoConstraints is a property that should be governed by the client of your view, not the view itself, so that's also part of the motivation why ideally you shouldn't need to care about that property when working in the IB document itself.
Someday we'll flip the default as more systems migrate to auto layout.
Kevin
On 19 Aug 2013, at 05:50, Kyle Sluder <email@hidden> wrote:
> On Aug 19, 2013, at 2:48 AM, Rick Mann <email@hidden> wrote:
>
>> I don't turn this on explicitly. But when I load a UIVieController into a view controller container, I'm getting bitching about unsatisfiable constraints, including NSAutoresizingMaskLayoutConstraint. But it's all from the same storyboard that uses autolayout. Why are there any autoresizing constraints?
>
> You don't control how view controllers position their child view controllers' views. For example, the root view controller's view is positioned within the window using -setFrame:, not with constraints.
>
> Make sure you haven't accidentally created a constraint system that will try to resize the window.
>
> --Kyle Sluder
>
> _______________________________________________
>
> 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
_______________________________________________
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