I use this function to create image from uiview :
UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 0.0f);
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
UIImage * snapshotImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return snapshotImage;
The code UIImage * snapshotImage = UIGraphicsGetImageFromCurrentImageContext();
make my screen have a glitch:
How can I resolve this issue? This only happen in ios8 . I do not have this issue in ios7 .
After much of trial and error, I found the course:
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
when afterScreenUpdates:
set to YES
, I will have that glitch. Once I set it to NO
, the problem go away.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.