Re: Autolayout warnings
Re: Autolayout warnings
- Subject: Re: Autolayout warnings
- From: Doug Hill <email@hidden>
- Date: Wed, 14 Dec 2016 14:48:20 -0800
Quincey,
Thanks for the reply.
> On Dec 14, 2016, at 2:40 PM, Quincey Morris <email@hidden> wrote:
>
> On Dec 14, 2016, at 14:19 , Doug Hill <email@hidden <mailto:email@hidden>> wrote:
>>
>> "<NSLayoutConstraint:0x7f91426a3ef0 'CommentContainerProportionalWidth' UIView:0x7f91426d9db0.width == 0.33*UIView:0x7f91426def30.width>",
>> "<NSLayoutConstraint:0x7f91426c91e0 'Hide Comments Constraint' H:[UIView:0x7f91426d7f00]-(0)-[UIView:0x7f91426d9db0]>",
>> "<NSLayoutConstraint:0x7f91426e2990 'ShowComments' UIView:0x7f91426d9db0.trailing == UIView:0x7f91426d7f00.trailing>",
>> "<NSLayoutConstraint:0x7f91427e43c0 'UIView-Encapsulated-Layout-Width' H:[UIView:0x7f91426def30(768)]>"
>
> It kinda looks like the conflict is between the first and last of these. When you move the comments view off to the trailing edge of what it’s aligned to, you seem to be making the enclosing view wider according to some combination of constraints, which violates the constraint (the last one) saying that the enclosing view is 768 pts wide.
The funky UIView-Encapsulated-Layout-Width constraint is not mine and I don't set it to 768. Not sure what it is.
> Can you set the comment view to 0 width when you hide it? That would probably eliminate the problem, although a different approach might be preferable. (For example, use conditional constraints on the view that expands to fill the space occupied by the comment view, relative to the enclosing view, and hide the comment view instead of moving it.)
I actually put a lot of time into trying to figure out how to architect the autolayout constraints to make everything move together using. This scheme seems good because, by not shrinking the container (which has a table view inside), it doesn't cause the table to relayout. But I'll try some of your techniques too.
Doug Hill
_______________________________________________
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