Re: layout question
Re: layout question
- Subject: Re: layout question
- From: Christiaan Hofman <email@hidden>
- Date: Sun, 03 Apr 2011 22:06:06 +0200
On Apr 3, 2011, at 18:03, Quincey Morris wrote: On Apr 3, 2011, at 03:16, Christiaan Hofman wrote: In that case you simply embed everything inside another big view that exactly contains the two views.
Yep, I was mostly just pointing out you need to take care with both inner *and* outer edges. Tracking down mysteriously drifting UI elements is one of the things I hate most. :) However, can we be sure that this trick works? Wouldn't rounding errors slowly mess things up, one pixel at a time?
That's the question that got me interested to start with, but I think I've convinced myself rounding errors don't affect this case: NSMaxX (leftRect) == NSMinX (rightRect), so the calculations should come out the same, unless the autoresize code does something unexpected like 'round (NSWidth (leftRect))' but 'floor (NSMinX (rightRect))'.
Maybe that would be unexpected, but for instance using floor for the width would most certainly not be unexpected. The bottom line is that you do not know what the actual implementation does, or will do in the future. And it's a fact that some autosizing behavior has changed between OS versions. And therefore you cannot count on this working, and should not use it in production code. Especially as this is fairly easy to avoid.
Christiaan
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden