-
Notifications
You must be signed in to change notification settings - Fork 0
captureScreen截图Bug #1
Copy link
Copy link
Open
Description
-
(UIImage *)__captureScreen {
//self.view.bounds.size, self.view.opaque
UIGraphicsBeginImageContextWithOptions(SCREEN_SIZE,self.view.opaque, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
// [self.view.layer renderInContext:context]; 当前未修改的
[[[UIApplication sharedApplication] keyWindow].layer renderInContext:context];//用keywindow可以解决tabbar截图黑屏的问题
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();return image;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels