开发者

How do I dismiss the AirPrint Popover?

I have a singleton popover, so that I only show one popover at a time. When I do my share popover, and choose AirPrint, the share popover correctly goes away, showing the AirPrint popover in its place.

But if I press the share button again, the share popover displays on top of the AirPrint popover.

I can't find a way of referencing the AirPrint popover to dismiss it.

Some further information - I have UIBarButtonItems on a toolbar at the bottom of the screen, and four UIBarButtonItems nested inside a navigationBar's rightBarButtonI开发者_开发百科tem at the top of the screen.

The UIBarButtonItems at the bottom of the screen correctly dismiss the AirPrint popover automatically, but the nested ones at the top do not.

But if I knew the name of the AirPrint popover, I could dismiss it from the top buttons' code.


The actual "AirPrint" UIPopoverController is not available to you. However, if you need to make it go away programmatically, you do:

[[UIPrintInteractionController sharedPrintController] dismissAnimated:YES];


You should be able to dismiss Printer popover view as below code.

UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
[pic dismissAnimated:YES];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜