• 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: iPhone orientation problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iPhone orientation problems


  • Subject: Re: iPhone orientation problems
  • From: Matt Neuburg <email@hidden>
  • Date: Sun, 25 Jul 2010 12:39:46 -0700
  • Thread-topic: iPhone orientation problems

>Everywhere, it is said that it should be handled automatically when adding the
subview to the window but it doesn't seem to work, at least not with my
controller layout.

My experience is that you have to wait until the window's primary subview
has itself rotated before you do any further interface configuration. I add
code like this to my main subview's controller:

- (void)didRotateFromInterfaceOrientation:
        (UIInterfaceOrientation)fromInterfaceOrientation {
    if (!didInitialSetup) { // once, at startup: set up interface
        didInitialSetup = YES;
        [self setUpInterface];
    }
}

That way I don't create the nested interface until the main view has settled
down into its initial rotation. Otherwise, if I do things too soon, x and y
are reversed and everything is wonky after that. This trick has really
helped me with autorotation, though I don't know if it will be useful in
your case.

m.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



_______________________________________________

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

  • Follow-Ups:
    • Re: iPhone orientation problems
      • From: Eric Giguere <email@hidden>
  • Prev by Date: NSStatusItemthreading
  • Next by Date: Re: Discard all drawing in a UIView
  • Previous by thread: iPhone orientation problems
  • Next by thread: Re: iPhone orientation problems
  • Index(es):
    • Date
    • Thread