Manimaran
Manimaran

Reputation: 577

How to fix Orientation error in ipad?

I have created a app which only working in landscape mode. The splash screen working correctly, but after the splash screen my first page not set for landscape mode. I have attached the screen shot, and here i give the code for supporting orientation methods. I check the bound size by printing the values it shows 0,0,768,1024 but i want 0,0,1024,768.Screen shot

//checking the frame size
CGRect theRect = self.view.bound;

NSLog(@" frame %f  %f  %f  %f", theRect.origin.x,
      theRect.origin.y,
      theRect.size.width,
      theRect.size.height);

//orientation method
- (BOOL) shouldAutorotate
{
return YES;
}

-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
 }
 -(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
UIInterfaceOrientation crntOrntatn = self.interfaceOrientation;
return UIInterfaceOrientationIsLandscape(crntOrntatn) ? crntOrntatn :      UIInterfaceOrientationLandscapeLeft;
}

 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
 {
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
 }

Upvotes: 0

Views: 188

Answers (1)

user2625110
user2625110

Reputation:

Check the app delegate. The navigation controller was initialized correctly?

Upvotes: 1

Related Questions