How Do I Take a Screen Shot of a UIView?

后端 未结 15 2779
-上瘾入骨i
-上瘾入骨i 2020-11-22 09:28

I am wondering how my iPhone app can take a screen shot of a specific UIView as a UIImage.

I tried this code but all I get is a blank image

15条回答
  •  天涯浪人
    2020-11-22 09:54

    Apple does not allow:

    CGImageRef UIGetScreenImage();

    Applications should take a screenshot using the drawRect method as specified in: http://developer.apple.com/library/ios/#qa/qa2010/qa1703.html

提交回复
热议问题