How to render a whole UITableView as an UIImage in iOS?

后端 未结 13 2168
太阳男子
太阳男子 2020-12-17 23:54

I have simple UITableView with some data. The table\'s height is greater than the screen size. Now I need to catch screenshot of this table (a whole table). I k

13条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-18 00:34

    You can create graphics context with the size of tableView.contentSize. After that you have to run loop threw all indexPaths and draw each cell. You can have one cell which will be reused for drawing cells which are out of screen - just change content of that with required data and draw it.

提交回复
热议问题