如何在UIPopoverController上显示UIView [英] How to show a UIView OVER a UIPopoverController

查看:75
本文介绍了如何在UIPopoverController上显示UIView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我有我的主视图,当我点击一个按钮时,UIPopoverController显示在我的主视图(不是全屏,所以我仍然看到后面的视图)包含一个UITableView。当我单击其中一个tableview单元格时,我想在屏幕上显示一个自定义视图(通知用户应用程序正在处理的简单视图)将在特定时间内淡入淡出。

In my app, I have my main view and when i click a button, a UIPopoverController is shown over my main view (not fullscreen so i still see the view behind) containing a UITableView. When I click one of the tableview cells, I want to show a custom view centered on screen (simple view informing the user that the app is processing) that will fade in and fade out during a specific amount of time.

问题是我的自定义视图始终显示在UIPopover下...我尝试了所有我能想到的,带有SubviewToFront等......没有任何作用...我也尝试包装我的自定义在UIViewController中查看并使用[mainView presentViewController:myCustomView ...]但是当我这样做时主视图消失

The problem is that my custom view always appears UNDER the UIPopover...I tried all I can think of, bringSubviewToFront etc...Nothing works... I also tried to wrap my custom view in a UIViewController and use [mainView presentViewController:myCustomView ...] but when I do that the main view disappear

有人可以帮忙吗?
Thx

Someone can help? Thx

推荐答案

Thx Ole Begemann,这个问题确实是重复的。
虽然,我的问题的解决方案不是将UIWindow子类化,而是将我的UIView添加到关键UIWindow:

Thx Ole Begemann, this question was indeed a duplicate. Although, the solution to my problem is not to subclass UIWindow but to add my UIView to the key UIWindow :

NSArray * windows = [[UIApplication sharedApplication] windows];
UIWindow* win0 = [windows objectAtIndex:0];

[win0 addSubview:loadingView];
[win0 bringSubviewToFront:loadingWindow];

这篇关于如何在UIPopoverController上显示UIView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆