Question

I want to persent a modalwindow, I use the PresentModalViewController and set the ModalPresentationStyle to UIModalPresentationStyle.FormSheet.

But how to persent the window as a pop layer such as the UIpopover, it allows the users to dismiss the popwindow just touch the outside of the popwindow area.

BTW, how to modify the UIpopover dark frame and set the UIPopoverArrowDirection to nothing ?

Was it helpful?

Solution

The way that I do this is to implement the popoverControllerShouldDismissPopover method from the UIPopoverControllerDelegate in my parent view controller class, and just return a NO. This will prevent the popover from disappearing when the user taps somewhere other than on the popover.

#pragma mark - UIPopoverControllerDelegate

- (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController
{
    return NO;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top