iOS:如何用动画效果打开相机? [英] iOS:How to open camera with animation effect?

查看:154
本文介绍了iOS:如何用动画效果打开相机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用动画效果打开相机,以便它应该出现相机只在父屏幕中打开。
我使用相机重叠屏幕和在主屏幕中的按钮的点击事件,相机重叠屏幕正在打开,在相机重叠屏幕有一个取消按钮关闭相机,因此,当关闭相机再次需要显示它应该出现的动画效果现在相机在相同的父级scree关闭。
我试过kCATransitionMoveIn但不完全满意,如果有一个更好的解决方案请帮助我。

I want to open camera with animation effect, so that it should appear that camera is opening in the parent screen only. I am using camera overlay screen and on click event of button in parent screen,camera overlay screen is opening,in camera overlay screen there is a cancel button to close the camera,so while closing the camera again I need to show the animation effect that it should appear that now camera is closed in the same parent scree. I have tried kCATransitionMoveIn but not fully satisfied,if any once has better solution please help me.

CATransition * contentAnimation = [CATransition animation];
    contentAnimation.type = kCATransitionMoveIn;
    contentAnimation.subtype = kCATransitionFromBottom;
    contentAnimation.duration = 1.0;
    contentAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
    [[self.view layer] addAnimation:contentAnimation forKey:kCATransition];
    //self.view.hidden = YES;
    [CATransaction commit];
    // Show the scanner overlay
    [self presentModalViewController:overlayController.parentPicker animated:TRUE];


推荐答案

我已解决问题, SDK示例作为参考,此 link1 link2 也帮助了我。

I have resolved the issue and I have taken the ZBar SDK example as a reference and this link1 and link2 also helped me.

这篇关于iOS:如何用动画效果打开相机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆