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.
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 ...
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.
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.
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.
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];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With