Skip to content

captureScreen截图Bug #1

@tsyouasd

Description

@tsyouasd
  • (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;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions