Re: Move views relative to other view with Autolayout
Re: Move views relative to other view with Autolayout
- Subject: Re: Move views relative to other view with Autolayout
- From: Ken Thomases <email@hidden>
- Date: Thu, 10 Mar 2016 15:35:53 -0600
On Mar 10, 2016, at 3:21 PM, Doug Hill <email@hidden> wrote:
>
> I can see that people use multiple constraints when moving between different layouts. But what I don’t get is how there can be an alignment constraint that doesn’t cause a layout update when views move? How does autolayout decide to use the constraint when originally laying out the view but ignores it when the view layout changes? Apparently I don’t understand this very well but the docs don’t seem to go out of their way to describe this difference either.
When using auto layout, the auto layout engine _determines_ the layout from the constraints. You can't change the layout other than by changing the constraints. You should not move a view by setting its frame or bounds or whatnot. If you do, the change will only be undone on the next layout pass, anyway. The "current" position of views is not an input to the auto layout system. The position of all views is an _output_ from that system.
Regards,
Ken
_______________________________________________
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