ios - 渲染一个 UIView ,其中某些东西会被动画化并从中导出视频
<p><p>如何从 UIView 录制一段时间的视频,就像我们录制手机屏幕的一部分一样? </p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><h2>使用 <a href="https://github.com/wess/Glimpse" rel="noreferrer noopener nofollow">Glimpse</a> </h2>
<p>Glimpse 允许您从 UIViews 创建视频。更多文档在这里,但基本上它通过拍摄一系列 UIView 的屏幕截图,然后创建一个快速视频并将其保存到应用程序的文档文件夹中来记录动画和 Action 。</p>
<p>这是一个示例用法:</p>
<pre><code>#import <Glimpse/Glimpse.h>
@implementation myViewController
- (void)viewDidAppear
{
;
// Create a new Glimpse object.
Glimpse *glimpse = [ init];
// Start recording and tell Glimpse what to do when you are finished
[glimpse startRecordingView:self.view onCompletion:^(NSURL *fileOuputURL) {
NSLog(@"DONE WITH OUTPUT: %@", fileOuputURL.absoluteString);
}];
// Create a subview for this example
UIView *view = [ initWithFrame:CGRectInset(self.view.bounds, 40.0f 40.0f)];
view.backgroundColor = ;
view.alpha = 0.0f;
;
// We are going to record the view fading in.
[UIView animateWithDuration:5.0 animations:^{
view.alpha = 1.0f;
} completion:^(BOOL finished) {
// Since our animation is complete, lets tell Glimpse to stop recording.
;
}];
}
@end
</code></pre></p>
<p style="font-size: 20px;">关于ios - 渲染一个 UIView ,其中某些东西会被动画化并从中导出视频,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/35422154/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/35422154/
</a>
</p>
页:
[1]