gpt4 book ai didi

android - fillAfter 和 fillEnabled 在 Android View 动画 XML 中不起作用

转载 作者:IT老高 更新时间:2023-10-28 23:01:46 25 4
gpt4 key购买 nike

我很好奇这种行为......我目前正在动画 XML 中设置这两个值:

    android:fillEnabled="true"
android:fillAfter="true"

但是,动画完成后转换不会应用......它总是重置。当我通过代码以编程方式设置它时,它似乎确实有效:

    animation.setFillEnabled(true);
animation.setFillAfter(true);

所以我只是好奇这应该如何工作,因为我宁愿在 XML 上设置它。谢谢!

最佳答案

我遇到了同样的问题,这对我有用:

<set
android:fillEnabled="true"
android:fillAfter="true"
xmlns:android="http://schemas.android.com/apk/res/android">

<translate
android:fromYDelta="0"
android:toYDelta="-20%p"
android:duration="7000" />

</set>

将属性fillEnabledfillAfter放入Set标签​​中。

关于android - fillAfter 和 fillEnabled 在 Android View 动画 XML 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6510300/

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