因此,假设我想制作截图并将其发布到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上测试了它。
发布于 2015-05-08 23:26:56
我知道这有点老了,但以下是对我有效的方法:
afterScreenUpdates后设置:否
https://stackoverflow.com/questions/20107587
复制相似问题