Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIActivityViewController has a weird size and shape

I just got this bug report for me app...the activity view controller is suddenly this weird narrow shape whether I'm on an actual phone or the view controller.

Narrow view controller

This is happening with some plain vanilla code that hasn't been touched in months:

UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[message] applicationActivities:nil];
[self presentViewController:activityViewController animated:YES completion:nil];

What could be going wrong? I can't even think of where to start troubleshooting this one.

like image 432
helloB Avatar asked Mar 04 '16 20:03

helloB


1 Answers

Have you tried reproducing this bug??? If we don't have the exact scenario of how this bug is getting created then we can't make a solution for it!!! Try updating the items in the array and check if the bug still exist... This type of things happens sometimes but until and unless we don't reproduce this scenario it can't be termed as bug.

Any way if you are working in universal app add below line of code before presenting the ActivityView

ActivityViewController.popoverPresentationController.sourceView = self.view;
[self presentViewController:activityViewController animated:YES completion:nil];

I will suggest, instead of looking for a solution dig out the problem first. I have never seen such weird behaviour of ActivityView before this and if we know why this happened then it will be helpful to every iOS developer.

like image 197
iOS_MIB Avatar answered Oct 04 '22 15:10

iOS_MIB