Note that there are some explanatory texts on larger screens.

plurals
  1. POUIIMagePicker camera landscape orientation issue
    primarykey
    data
    text
    <p>I have a view controller and i have added UIImagePicker as subview. On changing device orientation from portrait to landscape, camera appears to be on half screen rather than full screen. the images in the camera is also rotated 90 degrees. I am supporting device orientation in my app. how to fix this camera orientation issue. Any help is appreciated. </p> <p>//Code for presenting camera</p> <pre><code>- (id)init { self = [super init]; if (self) { UIImagePickerController * picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypeCamera ; picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto; picker.allowsEditing = YES; self.cameraPicker = picker; cameraPicker.view.frame = CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height );; //cameraPicker.view.frame = CGRectMake(0,0,[UIScreen mainScreen].bounds.size.width,[UIScreen mainScreen].bounds.size.height ); [self.view addSubview:cameraPicker.view]; } return self; } </code></pre> <p>//Code for supporting device orientation</p> <pre><code>-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { [self setFramesForControls:toInterfaceOrientation]; } -(void)setFramesForControls :(UIInterfaceOrientation)orientation { if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) { cameraPicker.view.frame = CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height ); } else if(orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) { cameraPicker.view.frame = CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height ); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload