iPhone OS是否支持隐式动画? [英] Does iPhone OS support implicit animation?

查看:64
本文介绍了iPhone OS是否支持隐式动画?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Mac OS X中的示例:

Example from Mac OS X:

[[aView animator] setFrame:NSMakeRect(100.0,100.0,300.0,300.0)]; 

我在UIKit中尝试过类似的方法,但是UIView似乎没有动画器方法。因此,没有隐式动画吗?

I have tried something similar in UIKit, but it seems the animator method is not there for UIView. So there's no "implicit" animation?

推荐答案

iPhone支持隐式动画,尽管它不使用动画对象,但它是直接内置到UIView中。改为尝试以下操作:

The iPhone supports implicit animation, though it does not use an animator object, it is built directly into UIView. Try this instead:

[UIView beginAnimations:nil context:nil];
[aView setFrame:NSMakeRect(100.0,100.0,300.0,300.0)];
[UIView commitAnimations];

确切的详细信息已记录在此处

The exact details are documented here.

每个视图也始终具有图层支持,因此您不必打开图层即可获得用于显式动画的图层。

Every view is always layer backed as well, so you don;t have to turn on layers in order to get a layer for explicit animation.

这篇关于iPhone OS是否支持隐式动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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