V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
lisonfan
V2EX  ›  C

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

  •  
  •   lisonfan · 2016-10-26 20:11:35 +08:00 · 1342 次点击
    这是一个创建于 2743 天前的主题,其中的信息可能已经有所发展或是发生改变。

    在按钮的点击事件里使用

        [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];
    

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

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

    wujichao
        1
    wujichao  
       2016-10-27 09:48:37 +08:00
    [UIView beginAnimations:nil context:nil];
    xxxxx
    [UIView commitAnimations];

    使用来禁用隐式动画的
    lisonfan
        2
    lisonfan  
    OP
       2016-10-27 09:53:30 +08:00
    @wujichao
    那只用:
    ```
    [UIView beginAnimations:nil context:nil];
    ```
    就可以了?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2644 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 14:06 · PVG 22:06 · LAX 07:06 · JFK 10:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.