Search code examples
iosmodalviewcontrollerpresentmodalviewcontrolleriiviewdeckcontroller

IIViewDeckController and presentViewController


I got iOS app, where i use IIViewDeckController for side controllers.

But when i try use presentViewController it lead to some strange effect: grey semi-transparent view over all screen.

For example choosing image for avatar.

In the beginning we got this screen:

enter image description here

Then we choosing new image with this code:

- (void)startCameraControllerWithSourceType:(UIImagePickerControllerSourceType)sourceType {
    if (![UIImagePickerController isSourceTypeAvailable:sourceType]) {
        return;
    }
    UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
    cameraUI.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    cameraUI.allowsEditing = YES;
    cameraUI.delegate = self;
    [self presentViewController:cameraUI animated:YES completion:nil];
}

So you can see presentViewController here. And then i see my gallery:

enter image description here

You can see semi-transparent view over gallery.

And the same view after canceling/accepting photo on previous viewController:

enter image description here

Can you help me? How should i remove this semi-transparent view?

Thnx.


Solution

  • To avoid this shadow, use:

    [viewDeckController setShadowEnabled:NO]