Sunday, 15 September 2013

UIActivityViewController rotation problems

UIActivityViewController rotation problems

I am having problem with the UIActivityViewController, I instantiate a new
instance each time user presses the 'share' button, but it will not rotate
properly. Is my code lacking something essential?
When I rotate only the status bar and the UIActivityViewController will
rotate (not the view in the background) and also sometimes the
activityView´s size will be wrong.
UIActivityViewController *activityVC;
// Init sharing items and View Controller
NSString *message = [NSString stringWithFormat:@""];
UIImage *imageToShare = [UIImage imageNamed:@"imageName"];
NSArray *postItems = @[message, imageToShare];
activityVC = [[UIActivityViewController alloc]
initWithActivityItems:postItems
applicationActivities:nil];
[self presentViewController:activityVC animated:YES completion:^() {
[activityVC setCompletionHandler:^(NSString *activityType, BOOL
completed) {
// Completed
}];
}];

No comments:

Post a Comment