[iOS 问题求助]一个关于动画的问题。

2016-10-26 20:11:35 +08:00
 lisonfan

在按钮的点击事件里使用

    [UIView animateWithDuration:10.0 animations:^{
        sender.titleLabel.font = [UIFont systemFontOfSize:18];
    } completion:nil];

没有动画效果。

但是这样写的话:

    [UIView beginAnimations:nil context:nil];
    sender.titleLabel.font = [UIFont systemFontOfSize:18];

就有动画效果。

但是如果在后面就上:

    [UIView commitAnimations];

动画效果又没了,这是为什么了?

在搜索引擎上搜了很久没找到答案。

1346 次点击
所在节点    C
2 条回复
wujichao
2016-10-27 09:48:37 +08:00
[UIView beginAnimations:nil context:nil];
xxxxx
[UIView commitAnimations];

使用来禁用隐式动画的
lisonfan
2016-10-27 09:53:30 +08:00
@wujichao
那只用:
```
[UIView beginAnimations:nil context:nil];
```
就可以了?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/315712

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX