Hello
I have an UIImage inside an UIImageView in my application.
In portrait mode, the image is centered but when I switch to the landscape mode it stills on the left.
So I added the following method in my .m file but the problem is that I have a TabBar application, so when I rotate the device on another tab and I go back to the tab containing the image, it doesn't rotate automatically.
There is a way to rotate automatically all the elements of the application when rotating the device on any tab ?
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
if((self.interfaceOrientation == UIDeviceOrientationLandscapeLeft) || (self.interfaceOrientation == UIDeviceOrientationLandscapeRight)){
background.image = [UIImage imageNamed:@"back2-landscape.png"];
} else if((self.interfaceOrientation == UIDeviceOrientationPortrait) || (self.interfaceOrientation == UIDeviceOrientationPortraitUpsideDown)){
background.image = [UIImage imageNamed:@"back2-portrait.png"];
}
}
Thank you :-)