سؤال

For some reason my camera controls are misaligned and are displaying cut off at the top of the screen. Below is the code that I've implemented to use the camera, is there anything that could fix this?

- (void)takePhoto {
     UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) {
        picker.sourceType = UIImagePickerControllerSourceTypeCamera;
        picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
    } else {
        picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
    }
    [MAINVIEWCONTROLLER presentViewController:picker animated:YES completion:nil];

}

enter image description here

هل كانت مفيدة؟

المحلول

check wantsFullScreenLayout and set it accordingly.

If you want full screen, you will also need to hide the status bar using setStatusBarHidden:withAnimation:

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top