I'm creating a small UIView of size 320 pixels width and 120 pixels height. I'm using following code to add the view to top most window.
baseview.frame = CGRectMake(0,20,320,120);
UIWindow* window = [[UIApplication sharedApplication] keyWindow];
[window addSubview:baseView];
[window bringSubviewToFront:baseView];
The above code is showing a view below the status bar and it is as expected. This is working fine when the app's orientation is portrait. But when the app's orientation is inverted portrait, i'm adding one more line of code to rotate the view and that is
[baseView setTransform:CGAffineTransformMakeRotation(-M_PI/2)];
But now, I'm seeing the view at the bottom of the application (instead of seeing at the top below status bar) and the baseview is rotate and appearing properly except the position at the bottom. How should I handled this situation to show the view under the status bar.