Re: loading UIView in correct orientation

  • On Fri, 03 Aug 2012 23:22:17 +0700, "Gerriet M. Denkmann" <gerriet...> said:
    >
    > I have a subclass of UIViewController which displays a small view in the center of the display.
    > shouldAutorotateToInterfaceOrientation: returns YES.
    > This view is only shown on demand.
    >
    >
    > The problem:
    > If the device is in Portrait-Up position when the ViewController is created then everything is fine.
    > Otherwise the centered view is loaded in the wrong position, and I have to rotate the device by 90° and back again, to get the centered view right.

    Same answer as the email I just sent. Rotation of views, and especially the problem of launching into a rotated interface, is well discussed in my book, in that same chapter:

    http://www.apeth.com/iOSBook/ch19.html

    You're falling prey to an elementary mistake, namely setting up the size/position of the view too early (in response to the wrong event). m.

    --
    matt neuburg, phd = <matt...>, <http://www.apeth.net/matt/>
    A fool + a tool + an autorelease pool = cool!
    Programming iOS 5! http://shop.oreilly.com/product/0636920023562.do
previous month august 2012 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today