Display navigationController on top

心不动则不痛 提交于 2019-11-28 14:26:59

From the so far discussion and debugging the code you want to have the photo browser on the pop-up with a navigation controller.

So here is the sample code which implements this functionality, have a look at it.

I have used the same KGModal sample code and extended as per the requirement. I have used Xib to have a view with navigation bar.

To dismiss the pop-up from any where in the app you can use the below line, as it is shared instance.

[[KGModal sharedInstance] hideAnimated:YES];

Update:

The reason for showing the photo browser with in folderView is, you are trying to present the photoBrowser within the folderView, so it was presenting within the folderView of very small height & not able to see any photo.

So my suggestion is, as the user taps on pop-up to view photoBrowser you just remove pop-up and present the photoBrowser from the viewController class, as other than this class everything is handled through views.

I have made the changes as per above & works fine, to the code given by you, download the code here and have a look at it.

Let me know if it fulfills your needs.

Thanks

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!