模仿iOS上的截图flash动画 [英] Imitating screenshot flash animation on iOS

查看:191
本文介绍了模仿iOS上的截图flash动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种复制闪烁动画的方法,即按住home + lock时播放。

Im looking for a way to copy the "blink" animation, that is played when pressing home+lock.

有人知道这个动画是否以某种方式可用?

Does anyone know if this animation is available somehow?

推荐答案

在iOS设备上按住home + lock时屏幕截图,屏幕闪烁白色。你的意思是这个效果?如果是这样,试试这个:

On an iOS device you take a screenshot when you press home + lock and the screen flashes white. Do you mean this effect? If so, try this:

在视图层次结构中添加一个带有白色背景颜色的 UIView ,使其覆盖整个屏幕。然后,启动一个动画,将此视图的不透明度淡化为零。完成后,从超级视图中删除视图:

Add a UIView with a white background color to your view hierarchy such that it covers the whole screen. Then, start an animation that fades the opacity of this view to zero. On completion, remove the view from its superview:

[UIView animateWithDuration: 0.5 
                 animations: ^{
                               whiteView.alpha = 0.0;
                             }
                 completion: ^(BOOL finished) {
                               [whiteView removeFromSuperview];
                             }
];

这篇关于模仿iOS上的截图flash动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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