If you don't want temporary rotations of the background view after which the background is changed to have the correct orientation, you'll need to turn off Autorotation for the View. No two ways about it.
You would need to handle the rotation of the buttons yourself. You can either make a nice layout or put them on for example a Scrollview and just resize that.
Either way, you'd need to add an observer to rotate it yourself,
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:)
name:UIDeviceOrientationDidChangeNotification object:nil];
And in didRotate you do the resize, with a nice animated transition, if you like.
- (void) didRotate:(NSNotification *)notification {
int ori=1;
UIDeviceOrientation currOri = [[UIDevice currentDevice] orientation];
if ((currOri == UIDeviceOrientationLandscapeLeft) || (currOri == UIDeviceOrientationLandscapeRight)) ori=0;
}
Hope that sorts you. If Navigation bars or status bars cause the View to get tucked in under the top bar, there are ways to fix that.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…