更新时间:2023-12-03 19:47:58
更现代的方法是使用 ViewPropertyAnimator
:
The more modern way of doing this is to use the ViewPropertyAnimator
:
view.animate()
.alpha(0f)
.withEndAction(new Runnable() {
@Override
public void run() {
// Do something.
}
})
.start();
或者,如果您使用的是 RetroLambda:
Or, if you're using RetroLambda:
view.animate()
.alpha(0f)
.withEndAction(() -> {
// Do something.
})
.start();