Android 如何在运行时更改XML属性?
我正在尝试为我的应用程序实现一个挂起的过渡动画 我已经用函数克服了挂起的转换 覆盖转换(R.anim.incomming,R.anim.outing) 在outgoing.xml文件中,类似于:Android 如何在运行时更改XML属性?,android,xml,Android,Xml,我正在尝试为我的应用程序实现一个挂起的过渡动画 我已经用函数克服了挂起的转换 覆盖转换(R.anim.incomming,R.anim.outing) 在outgoing.xml文件中,类似于: <?xml version="1.0" encoding="UTF-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <scale android:pivot
<?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代码中改变这个值呢
我知道一些关于SharedReference的事情,但是xml文件中的变量与SharedReference不同。那么我应该怎么做呢?在这种情况下,似乎不可能在xml文件的运行时更改属性的值。也许最简单的方法是创建其他xml文件,并决定在运行时将哪些文件用作动画资源。感谢您的回复,但数据透视值是屏幕上的位置,范围很大:(还有其他建议吗?