IOS SDK - how to screen shot content of tableView?

后端 未结 3 1400
情书的邮戳
情书的邮戳 2020-12-30 08:47

How to screen-shot ALL content of tableView? (all content = visible are + NOT visible area)

I tried this:

UIGraphicsBeginImageContext(self.tableView.         


        
3条回答
  •  北海茫月
    2020-12-30 08:58

    You have to use contentSize.height for getting the height of tableview

    Try this

    UIGraphicsBeginImageContext(self.tableView.contentSize.height);
    [self.tableView.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage* image1 = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    self.imageView.image = image1;
    

提交回复
热议问题