1

I am working on an iPad app. It is to capture the image in popover and crop the image in full screen in next view. Here it consists of following screens

1) LoginViewContoller(need all orientations),

2)SplitViewController(need all orientations),`

3)ImageCropViewController(need only landscape),

4)SettingsViewController(need all orientations).

In ImageCropViewController I am writing following code:

- (BOOL)shouldAutorotate
{
    return NO;
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}

I am getting the exact orientation. But Its effecting LoginViewController's and SettingViewController's Orientation also.

In LoginViewController and SettingViewController ,i am writing following code

- (BOOL)shouldAutorotate
    {
        return YES;
    }

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape | UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
}

While navigating from SplitViewController to ImageCropViewController ,i am initiating the ImageCropViewController as rootViewController.

In plist I have supported orientations like this

enter image description here I googled it. And integrated the available codes. But I did not find any solution. Please help me. Its really killing my time.

1 Answers1

0

This is the way I have it set up on my iPhone Project but it shouldn't be any different for yours:

First, make sure your Project supports all of your desired orientations:

Supported Interface Orientations

Then, override these methods on your SplitViewController, ImageCropViewController and SettingsViewController:

- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskAll;
}

Finally, override these methods on your ImageCropViewController:

- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}

Let me know if it helps!

Pedro Mancheno
  • 5,237
  • 4
  • 24
  • 31