This are getting me a little confuse. I know the 2 properties in UIScreen about the size screen, like in this question use applicationFrame, and this uses bounds.
- applicationFrame - Show the size of device minus the statusBar. Making a NSLog in a iPhone, i get this values: (x=0, y=20, height= 460, width = 320)
- bounds - Show all size screen. The values is: (x=0, y=0, height=480, width=320)
Now, if I rotate the device (potrait to ladscape) this will show (The bounds will be all the same value)
- Go to function: shouldAutorotateToInterfaceOrientation: x= 0 y=20 height= 460 width= 320
- return YES so
- Go function: didRotateFromInterfaceOrientation: x= 20 y=0 height= 480 width= 300
- I don't know why, but this pass one more time in shouldAutorotateToInterfaceOrientation and show: x= 20 y=0 height= 480 width= 300 (Is this a bug?)
I want to resize my view to this new size, but if I get the CGRect, it will give the correct size in the didRotateFromInterfaceOrientation and the height will be width and vice-versa.
Are there a good way to beautiful resize my view without setting this values by hand?