How to get status bar images in iPhone APP
I want to get status bar images without UIGetScreenImage() because this method is Private API.
Apple recommend
http://developer.apple.com/iphone/library/qa/qa2010/qa1703.html
as a alternate solution, but this way can't get status bar images.
Would like to know how to get stat开发者_StackOverflow中文版us bar images?
This is impossible without using the Private API.
Referencing this duplicate: Emailing full screen of iPhone app
CGImageRef UIGetScreenImage();
@interface UIImage (ScreenImage)
+ (UIImage *)imageWithScreenContents;
@end
@implementation UIImage (ScreenImage)
+ (UIImage *)imageWithScreenContents
{
CGImageRef cgScreen = UIGetScreenImage();
if (cgScreen) {
UIImage *result = [UIImage imageWithCGImage:cgScreen];
CGImageRelease(cgScreen);
return result;
}
return nil;
}
@end
精彩评论