Presentation of a modal view controller from a child view controller

In my application, I present a modal view controller, but I am having problems that, in my opinion, are caused by the fact that I present view controllers from a child view controller.

The call for presentViewController: animated:comes from the view controller, which is on the navigation controller stack, and that the navigation controller is contained in another view controller, using the "Container View" in Interface Builder. This external container controller has a persistent banner at the top of the screen.

When the view manager is presented, it animates the scroll up, and when it gets to the top, it falls under the banner of the container view controller. However, as soon as the animation ends, it appears in front again, but interaction with the modular view controller, which will be covered by the banner, will not be possible. What is the correct way to present a modal view controller from a child view controller?

EDIT:

I tried to connect directly to the container controller, which works first, but after the modal view manager is rejected, the container view somehow expands to fill the entire screen, overlapping the entire banner.

EDIT:

Screenshot:

fh90bdT.png

The modal view controller slides up and appears under the banner at the top, and then suddenly jumps to the foreground.

+4
6

, , . , - , .

0

AppDelegate , modelviewconroller.

- (void)presentModelView{
    [[[[self.window rootViewController] navigationController] topViewController] presentViewController:controller animated:YES];
}

- (void)dismissModelView{
    [[[[self.window rootViewController] navigationController] topViewController] dismissViewControllerAnimated:YES completion:<#^(void)completion#>:controller animated:YES];
}
+3

: : dismissViewControllerAnimated , , .

.

" ". ( )

enter image description here

+2

, - :

[self.parentViewController presentViewController:controller animated:YES];

, self.parentViewController.parentViewController

0

ChildViewController :

[self presentModalViewController:viewController animated:YES];
0

. :

[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:controller animated:YES];

. , , , , , , . , , presentedViewController , , nil.

-1

All Articles