Matteo Simoni
Matteo Simoni

Reputation: 13

Interface rotation work on iOS 6 but non on iOS5

My app rotation is working correctly on iPad 3 and iPad 2 with iOS6 but not on iPad1 with iOS5.

I'm using a tab bar controller and 5 view controller. On each view controller i have this code:

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration{
if(self.interfaceOrientation == UIDeviceOrientationPortrait||self.interfaceOrientation == UIDeviceOrientationPortraitUpsideDown){
    self.view=self.VerticaleAppunti;
    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"FONDO_VERT.jpg"]];
}
if(self.interfaceOrientation == UIDeviceOrientationLandscapeLeft||self.interfaceOrientation == UIDeviceOrientationLandscapeRight){
    self.view=self.OrizzontaleAppunti;
    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"FONDO.jpg"]];
}

}

Upvotes: 0

Views: 282

Answers (1)

gling
gling

Reputation: 38

You can try to implement this method for orientation change in ios 5:

    - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
   //support for all orientation change 
    return YES;
}

orientation support in ios5

Upvotes: 2

Related Questions