Re: what happens when layout constraint height and frame height conflict (iOS)?
Re: what happens when layout constraint height and frame height conflict (iOS)?
- Subject: Re: what happens when layout constraint height and frame height conflict (iOS)?
- From: Ken Ferry <email@hidden>
- Date: Mon, 26 Nov 2012 18:07:45 -0800
Think of setFrame: outside of layout the same way you think of drawing outside of drawRect:
It will "work" in the sense that the frame will be changed, but it's just going to get stomped the next time the layout pass comes around.
Sent from my iPhone
On Nov 26, 2012, at 10:46 AM, Matt Neuburg <email@hidden> wrote:
> I have noticed by experimentation that if I have a layout constraint on a view that sets its height at (say) 36, I can later change the view's frame in code to set its height at (say) 50. The view's height does visibly change, but logging proves that the layout constraint does not change.
>
> (1) How can this be? The view would appear to be violating its own layout constraint.
>
> (2) More important: Is this a bad situation? In other words, once I've decided to use layout constraints at all, must I then use them for everything and avoid frame/bounds? Can something bad happen later because of this conflict?
>
> Thx - m.
>
> --
> matt neuburg, phd = email@hidden, http://www.apeth.net/matt/
> pantes anthropoi tou eidenai oregontai phusei
> Programming iOS 5! http://shop.oreilly.com/product/0636920023562.do
> RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
> TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
>
>
> _______________________________________________
>
> 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