如何使用动画UIWebview捕获iPhone屏幕?

时间:2014-06-04 06:14:26

标签: uiwebview presentation-layer

我刚刚创建了用于屏幕视频捕获的代码..使用UIView完美地工作。但是如果我使用UIWebview而不是捕获屏幕视频显示卡住..我知道原因。原因是在使用网络时查看

  

[[self.layer presentationLayer] renderInContext:mycontext];

无效......我的应用程序崩溃了

所以,如果表示层不起作用,视频将被卡住。 并使用此行

  

[self.layer renderInContext:mycontext];

屏幕捕获工作正常,但视频显示卡住了。

这是代码,用户可以浏览他或她手机中的任何网站。

UIGraphicsBeginImageContextWithOptions(self.bounds.size, YES, 0.0);

CGContextRef mycontext = UIGraphicsGetCurrentContext();

if([[self.layer presentationLayer] respondsToSelector:@selector(renderInContext:)])
{
    [[self.layer presentationLayer] renderInContext:mycontext];
}
else
{
    [self.layer renderInContext:mycontext];
}


UIImage* image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

滚动网页视图并捕获视频时,显示捕捉屏幕视频时卡住了..

有什么解决方案吗?

0 个答案:

没有答案