How to create UIImage from UIWebView

前端 未结 1 932
萌比男神i
萌比男神i 2020-12-20 07:18

In the ipad app im planning to do, it will be all about loading web pages in UIWebView. I have a feature wherein I will display previews of the UIWebViews, more like thumbna

1条回答
  •  天命终不由人
    2020-12-20 08:00

    UIGraphicsBeginImageContext(yourWebView.bounds.size);
            [yourWebView.layer renderInContext:UIGraphicsGetCurrentContext()];
            UIImage *resultImageView = UIGraphicsGetImageFromCurrentImageContext();
            UIGraphicsEndImageContext();
    

    this resultImageView will be your answer...

    0 讨论(0)
提交回复
热议问题