I'm wrestling with this problem. I need a portrait view and a landscape view for my App. Now when I create 2 buttons that show me a portrait view and a landscape view (forced by shouldAutorotateToInterfaceOrientation) they show up just fine. But when I call the views from within the result code of an imagepicker, the portraitview works just fine, but the landscape view get returned like this. http://bit.ly/bfbobc.
So just the make it clear: the nob is already turned 90 degrees, the imageviewcontrol is only shown half (the right part is off-screen)... But the iPhone isn't forced into landscape mode...
Can someone please explain me what's going on here or how I can achieve this! Any help is welcome!
This is how I call the views from withing the imagepickercontroller result code.
`- (void) imagePickerController:(UIImagePickerController *)vcImagePicker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSLog(@"The picture was taken/chosen, now we need to decide which view to present");
[vcImagePicker dismissModalViewControllerAnimated:YES];
UIImage *chosenPicture = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
if (chosenPicture.size.width > chosenPicture.size.height) {
NSLog(@"pic is in landscape");
EditLandscapeScreen *vcEditLandscapeScreen = [[EditLandscapeScreen alloc] initWithNibName:@"EditLandscapeScreen" bundle:nil];
vcEditLandscapeScreen.ChosenImage = chosenPicture;
[self.view addSubview:vcEditLandscapeScreen.view];
[vcEditLandscapeScreen release];
}
else {
NSLog(@"pic is in portrait");
EditPortraitScreen *vcEditPortraitScreen = [[EditPortraitScreen alloc] initWithNibName:@"EditPortraitScreen" bundle:nil];
vcEditPortraitScreen.ChosenImage = chosenPicture;
[self.view addSubview:vcEditPortraitScreen.view];
[vcEditPortraitScreen release];
}
}`