UIPopoverController dismiss on 'tap off' - how do I detect this event?

痞子三分冷 提交于 2019-12-23 10:25:21

问题


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

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

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

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


回答1:


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...
}


来源:https://stackoverflow.com/questions/6212988/uipopovercontroller-dismiss-on-tap-off-how-do-i-detect-this-event

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