gpt4 book ai didi

android - 没有调用 start 的 ViewPropertyAnimator,有区别吗?

转载 作者:太空狗 更新时间:2023-10-29 13:20:08 27 4
gpt4 key购买 nike

有时我会看到这样的代码

view.animate().alpha(1).start();

有时

view.animate().alpha(1);

有什么区别(如果有的话)?

动画总是开始,但根据我对源代码的理解,在开始调用之前,后台会发生两件完全不同的事情。

最佳答案

public void start ()

Starts the currently pending property animations immediately. Calling start() is optional because all animations start automatically at the next opportunity. However, if the animations are needed to start immediately and synchronously (not at the time when the next event is processed by the hierarchy, which is when the animations would begin otherwise), then this method can be used.

Source

唯一的区别是使用 start 它会立即开始。

关于android - 没有调用 start 的 ViewPropertyAnimator,有区别吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30011686/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com