Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 607
Caroline Avatar asked Jun 22 '11 03:06

Caroline


People also ask

How to dismiss the Popover when on an outside click?

Let's look at the two simplest ways of dismissing the popover. You can pass the additional prop rootClose to your OverlayTrigger component to dismiss the popover when on an outside click. 1 ... 2 <OverlayTrigger trigger="click" rootClose placement="right" overlay={popover}> 3 ...

How do I remove a popover from my website?

Another method to dismiss the popover is by using a different trigger event. You can use the hover or focus trigger instead of the click trigger to achieve this. The hover trigger isn't the correct solution since it removes the clicking action on the popover, rendering it a tooltip.

Is there a way to make a tooltip for popovers?

You can use the hover or focus trigger instead of the click trigger to achieve this. The hover trigger isn't the correct solution since it removes the clicking action on the popover, rendering it a tooltip. Use the focus trigger instead.

How to hide the Popover from the overlay?

The onHide method is just a callback invoked by the overlay when it wishes to be hidden and is required if rootClose is specified. Another method to dismiss the popover is by using a different trigger event.


2 Answers

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];
like image 199
Dave DeLong Avatar answered Oct 19 '22 23:10

Dave DeLong


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

UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
[pic dismissAnimated:YES];
like image 42
conecon Avatar answered Oct 19 '22 22:10

conecon