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.
Now, if I rotate the device (potrait to ladscape) this will show (The bounds will be all the same value)
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?
(Assuming this point was for rotating from landscape back to portrait)
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?)
Its not a bug!
shouldAutorotateToInterfaceOrientation is called before the UI rotates to match the orientation of the device. So, in the first case (Portrait to Landscape) it gives you the rect for the portrait orientation. in the second case (Landscape to Portrait) it gives you the rect for the Landscape orientation.
Bottomline:
shouldAutorotateToInterfaceOrientation gives CGRect values before initiating the UI rotation
didRotateFromInterfaceOrientation gives CGRect values after completing the UI rotation
I suggest you look autoresizesSubviews and autoresizingMask properties of UIView. This saves a lot of headaches when you are working with views that have to rotate/resize.
Hope I have answered your question and you find this useful!