明确禁止的UIView动画的iOS4 + [英] Explicitly disabling UIView animation in iOS4+

查看:183
本文介绍了明确禁止的UIView动画的iOS4 +的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读,苹果推荐使用的,而不是CATransaction基于块的动画

之前,我就是用这个code禁用动画:

  [CATransaction开始]。
[CATransaction setDisableActions:YES];
//!调整
[CATransaction提交]

有没有做这一个新的推荐方法,或者是这还好吗?


解决方案

  [UIView的setAnimationsEnabled:NO];
//这里动画
[UIView的setAnimationsEnabled:YES];

I have been reading that Apple recommends to use block-based animations instead of CATransaction

Before, I was using this code to disable animations:

[CATransaction begin];
[CATransaction setDisableActions: YES];
// !!! resize
[CATransaction commit];

Is there a new recommended method to do this, or is this still okay?

解决方案

[UIView setAnimationsEnabled:NO];
//animate here
[UIView setAnimationsEnabled:YES];

这篇关于明确禁止的UIView动画的iOS4 +的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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