I have a problem on my iPad application using a UISplitView. Basically, I have another button which toggles a Popover (different from the basic splitview popover). An image might explain my problem better: enter image description here The problem is only there in Portrait mode.

There are 2 cases possible:

  • First tap is on the "Folders" button, second tap is on the "settings cogwheel" button, everything works well there: only one popover shows at a time, because I know how to register the action on the settings button.

  • First tap is on my "settings" button, second one is on the "folders" button. In this case I don't know how to dismiss the "settings" popover, because I don't know how to register the touch on the default button made available by the splitview. (that's the problem on the picture)

Do you know how I could handle the touch event on the default "Folders" button offered by the splitview?

有帮助吗?

解决方案

Fixed it! There's a delegate method called by the splitview when its popover is going to present a view controller, here it is:

//-------------------------------------------------------------------------------------
// splitViewController:popoverController:willPresentViewController:
//-------------------------------------------------------------------------------------
- (void)splitViewController:(UISplitViewController *)svc
         popoverController:(UIPopoverController *)pc
 willPresentViewController:(UIViewController *)aViewController
{
    [self.popoverSettings dismissPopoverAnimated:YES]; //dismiss the other popover here
}

Apple's documentation here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top