1

I have added the popOvercontroller on click of navigation bar right button.i don't want the animation effect..can anybody tell me how to disable it???

3 Answers 3

6

There are two pieces to this. Using presentPopoverFromBarButtonItem:permittedArrowDirections:animated:NO or presentPopoverFromRect:permittedArrowDirections:animated:NO to present the popover will prevent the "appearing" animation. To disable the disable the "disappearing" I had to add this to the delegate:

- (BOOL) popoverControllerShouldDismissPopover:(UIPopoverController *)popover {
    // Any cleanup code (popoverControllerDidDismissPopover won't be called)

    [popover dismissPopoverAnimated:NO];
    return NO;
}
1
  • +1 for adding "ShouldDimissPopover" as I needed to remove animation from the dismiss operation. Nov 15, 2012 at 21:01
1

How do you instantiate it? the docuemntation mentions presentPopoverFromBarButtonItem:permittedArrowDirections:animated: - sounds like the perfect answer to your question.

0

Btw. if you're showing a popover from a table view, you'll want to animate row deselection at the same time while popover is being dismissed. To achieve this, you can use:

- (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popover {
    [self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES];
    [popover dismissPopoverAnimated:YES];
    return NO;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.