V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
lisonfan
V2EX  ›  C

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

  •  
  •   lisonfan · Oct 26, 2016 · 1815 views
    This topic created in 3474 days ago, the information mentioned may be changed or developed.

    在按钮的点击事件里使用

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

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

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

    CDuXZMAPgHp1q9ew
        1
    CDuXZMAPgHp1q9ew  
       Oct 27, 2016
    [UIView beginAnimations:nil context:nil];
    xxxxx
    [UIView commitAnimations];

    使用来禁用隐式动画的
    lisonfan
        2
    lisonfan  
    OP
       Oct 27, 2016
    @wujichao
    那只用:
    ```
    [UIView beginAnimations:nil context:nil];
    ```
    就可以了?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2474 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 08:01 · PVG 16:01 · LAX 01:01 · JFK 04:01
    ♥ Do have faith in what you're doing.