简体   繁体   中英

How can I take snapshots for an iOS control, like UIView?

This is an unusual requirement, but let's say I have an UITableView with many UIButtons inside each UITableViewCell. What I want to achieve is to make a picture of several UIButtons(may not belong to same UITableViewCell), and I want the picture to be exactly the same as how they were presented to user.

I did try to search the apple developer library, but seems like this is unusual enough that no existing documents covers it.

I suppose at least I can get all the properties(size,font,color/image, etc) and draw it myself. But anyone know an easier way of doing this? And even if there is none and I have to draw the picture myself, where is a good place to start?

Thanks.

I presume you want to take a screenshot using UIView . UIButton , UILabel , etc. subclass from UIView

This explains how to do that

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM