所以,假设我想制作截图并在Twitter上发布。呈现时SLComposeViewController闪烁。
UIImage *image;
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, NO, [UIScreen mainScreen].scale);
[self.view drawViewHierarchyInRect:self.view.bounds afterScreenUpdates:YES];
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
SLComposeViewController *compose = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[compose addImage:image];
[self presentViewController:compose animated:YES completion:nil];
仅当“afterScreenUpdates:YES”,“afterScreenUpdates:NO”不闪烁时才会发生此行为。
为什么会眨眼?我在iPhone 5上测试它。
答案 0 :(得分:0)
我知道这有点旧,但这对我有用:
设置afterScreenUpdates:NO