我遇到了 UIActivityViewController 的问题,每次用户按下“共享”按钮时我都会实例化一个新实例,但它不会正确旋转。我的代码是否缺少必要的东西?
当我只旋转状态栏并且 UIActivityViewController 会旋转(而不是背景中的视图)并且有时 activityView 的大小会是错误的。
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
}];
}];