I want to make the same animation in xml as in code. I code I have this
Animation a = new TranslateAnimation(Animation.RELATIVE_TO_PARENT , 1.1f, Animation.RELATIVE_TO_PARENT, -0.2f,
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f);
I start with this in my xml anim file but I do not know how to tall him that the translation should be relative to parent
<translate
android:duration="2500"
android:fromXDelta="-0.1"
android:fromYDelta="0"
android:toXDelta="200"
android:toYDelta="0" />
Namely I do not know how to specify the fromXType attribute
fromXType Specifies how fromXValue should be interpreted. One of Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or Animation.RELATIVE_TO_PARENT.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.