I have a UIActivityViewController that I am presenting in a popover on the iPad (using a UIPopoverPresentationController).
When the popover is shown initially, its size is correct. When I tap 'More', a 'Activities' view is presented. When I tap 'Done', the UIActivityViewController doesn't resize to its initial size and the content within the UIActivityViewController unfortunately doesn't take up the entire view.
Here is the steps taken:
Display the UIActivityViewController:

The popover expands in order to prevent the text from being cut off.
Tap on the 'Done' button on the navigationBar:

The popover doesn't resize again to what its initial size was.
The code in creating and showing the UIActivityViewController:
- (void)actionButtonTapped:(id)sender {
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[self.pdfSummary] applicationActivities:nil];
BOOL canSendMail = [MFMailComposeViewController canSendMail];
NSMutableArray *excluded = [@[UIActivityTypeAddToReadingList,
UIActivityTypeAssignToContact,
UIActivityTypeCopyToPasteboard,
UIActivityTypeMessage,
UIActivityTypePostToFacebook,
UIActivityTypePostToFlickr,
UIActivityTypePostToTencentWeibo,
UIActivityTypePostToTwitter,
UIActivityTypePostToVimeo,
UIActivityTypePostToWeibo,
UIActivityTypeSaveToCameraRoll] mutableCopy];
if (!canSendMail) {
[excluded addObject:UIActivityTypeMail];
}
activityViewController.excludedActivityTypes = excluded;
[self showActivityViewController:activityViewController fromBarButtonItem:sender];
}
And the showActivityViewController method looks something like:
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:activityViewController];
navController.modalPresentationStyle = UIModalPresentationPopover;
navController.navigationBarHidden = YES;
UIPopoverPresentationController *popoverPresentationController = [navController popoverPresentationController];
popoverPresentationController.permittedArrowDirections = arrowDirection;
popoverPresentationController.barButtonItem = buttonItem;
[self presentViewController:navController animated:YES completion:nil];
return popoverPresentationController;
Is there any workaround for this. Resizing the popover or just keeping it one size?
I have tried subclassing UIActivityViewController and changing the preferredContentSize, but the UIActivityController's content wouldn't resize to fit the popover's size

UIActivityViewController. - rmaddyUIActivityViewControllerin a popover on the iPad @rmaddy? - user3253063popoverPresentationControllerdirectly from theUIActivityViewControllerand set itsbarButtonItem. - rmaddy