UIPopoverController 在“点击关闭"时关闭 - 如何检测此事件? [英] UIPopoverController dismiss on 'tap off' - how do I detect this event?

查看:30
本文介绍了UIPopoverController 在“点击关闭"时关闭 - 如何检测此事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在导航栏上使用了 UIPopover.我有几个 UIBarButtonItems,弹出框从其中一个扩展而来.

I am using a UIPopover on my navigation bar. I have several UIBarButtonItems and the popover extends from one of these.

当 popOver 被激活时,我将按钮的样式更改为 UIBarButtonItemStyleDone.

When the popOver is activated I changed the style of the button to UIBarButtonItemStyleDone.

但是,通过按预期点击 UIPopoverController 来关闭 popOver,但在此之后我想将样式更改回 UIBarButtonItemStyleBordered.

However, the popOver is dismissed by tapping off the UIPopoverController as expected, but upon this I want to change the style back to UIBarButtonItemStyleBordered.

有什么方法可以检测到 UIPopOverController 是否正在关闭?因此,根据我自己的需要搭载它?

Is there a way I can detect if the UIPopOverController is closing? And therefore piggyback this for my own needs?

推荐答案

实施 -popoverControllerDidDismissPopover: 方法在你的 UIPopoverControllerDelegate 中,你应该能够做些什么你需要在那里做.

Implement the -popoverControllerDidDismissPopover: method in your UIPopoverControllerDelegate and you should be able to do what you need to do in there.

- (void) popoverControllerDidDismissPopover:(UIPopoverController *) popoverController {
   //do stuff here...
}

这篇关于UIPopoverController 在“点击关闭"时关闭 - 如何检测此事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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