iOS 原生截屏方法

-(UIImage*)captureScreenForView:(UIView*)currentView {

      UIGraphicsBeginImageContext(currentView.frame.size);

                  [currentView.layer renderInContext:UIGraphicsGetCurrentContext()];

                  UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();

                  UIGraphicsEndImageContext();

      returnviewImage;

}

你可能感兴趣的:(iOS 原生截屏方法)