BlueSky
BlueSky

Reputation: 747

iOS: How to persent a modalview as the UIPopover style

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 ?

Upvotes: 0

Views: 135

Answers (1)

BP.
BP.

Reputation: 10083

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;
}

Upvotes: 1

Related Questions