• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: layout question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >layout question (From: nightwave <email@hidden>)
 >Re: layout question (From: Andy Lee <email@hidden>)
 >Re: layout question (From: Chris Suter <email@hidden>)
 >Re: layout question (From: Andy Lee <email@hidden>)
 >Re: layout question (From: Quincey Morris <email@hidden>)
 >Re: layout question (From: Andy Lee <email@hidden>)
 >Re: layout question (From: Quincey Morris <email@hidden>)
 >Re: layout question (From: Christiaan Hofman <email@hidden>)
 >Re: layout question (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: C++ and boost
  • Next by Date: Where Do User Templates Go Under XCode 4
  • Previous by thread: Re: layout question
  • Next by thread: Re: layout question
  • Index(es):
    • Date
    • Thread