开发者

How do I take a Screen Shot of a UIView that hasn't been loaded yet?

开发者 https://www.devze.com 2023-02-19 12:49 出处:网络
To explain the main features of my iPhone app I want to create a modal view, which shows some screen shots of my app in the background and some explanations on top.

To explain the main features of my iPhone app I want to create a modal view, which shows some screen shots of my app in the background and some explanations on top.

I create the screen shots (in the background) with

self.tabBarController.select开发者_如何学GoedIndex = selectedTab;

UIGraphicsBeginImageContext(CGSizeMake(320,480));
CGContextRef context = UIGraphicsGetCurrentContext();
[self.tabBarController.view.layer renderInContext:context];
UIImage *screenShot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

But some of the views in my tabBarController may not have been fully loaded yet.

Also the layout of almost all views looks distorted in the screen shots.

Any suggestions?

Thank you!


Design your app first without the screenshots first. Take real screenshots from the device and annotate them and include them in your app.

If you don't want to do that, then you are stuck.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号