Display navigationController on top

前端 未结 2 1581
别跟我提以往
别跟我提以往 2020-12-12 05:08

I have set up a subview \"popup\" in my application and I want to show a navController if the user taps a button on the subview popup. I\'ve set up the button so far, but if

2条回答
  •  猫巷女王i
    2020-12-12 05:27

    I noticed this line of code:

    [[KGModal sharedInstance] showWithContentView: contentView andAnimated: YES];
    

    And I can only think that, since it is a singleton, it adds the contentView on the UIApplication's key window. If that is the case, then a modal view controller will always be below the popup. You can solve this by adding a new method to the KGModal class

    - (void) showWithContentView: (UIView*)           contentView
                inViewController: (UIViewController*) controller
                     andAnimated: (BOOL)              animated;
    

    the method should show the popup in the specified controller's view; you should use that method instead.

    Edit

    After some more digging, I found that KGModal displays the popup on another window. The quickest fix would be to dismiss the popup, then show the nav controller.

提交回复
热议问题