Take screenshot of the window

后端 未结 2 1069
遇见更好的自我
遇见更好的自我 2021-01-16 05:32

I\'m using this method to take a screenshot of my app:

+ (NSData*)TakeScreenshot 
{
    // Create a graphics context with the target size
    // On iOS 4 and         


        
相关标签:
2条回答
  • 2021-01-16 06:09

    What you're using is more or less the official way Apple suggests to take a screenshot.

    The problem is that this method takes a screenshot of your application output on screen and not of your whole screen. The status bar is in its own window and could not be taken within your application.

    You should create your own status bar as an image and add it to your project or just cut the part of the screenshot you don't need.

    Then, I suggest to search the forum for possible duplicate of your question, like this one: Capturing full screenshot with status bar in iOS programmatically

    0 讨论(0)
  • 2021-01-16 06:31

    There is no public method which allows you to take a screenshot of the entire screen (i.e. with the status bar). There is a private method though UIGetScreenImage which allows you to use achieve this functionality. But, since it's a private method you will get your app rejected if you submit it to the App Store.

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