我正在尝试为我的应用实现待处理的转换动画。
我已经用功能
覆盖了待处理的转换overridePendingTransition(R.anim.incomming,R.anim.outgoing);
并在outgoing.xml文件中,它类似于:
<?xml version="1.0" encoding="UTF-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<scale
android:pivotX="50%"
android:pivotY="50%"
android:fromXScale="1.0"
android:fromYScale="0"
android:toXScale="1.0"
android:toYScale="1.0"
android:startOffset="300"
android:duration="300" />
</set>
我想在运行时更改android:pivotY,那么如何在java代码中更改此值?
我对SharedPreference有所了解,但xml文件中的变量与SharedPreference不同。那我该怎么办?
答案 0 :(得分:0)
在这种情况下,似乎无法在xml文件中更改运行时属性的值。也许直接的方法是创建其他xml文件并决定在运行时使用哪个作为动画资源。