【发布时间】:2015-10-16 18:11:40
【问题描述】:
ImageView 大于屏幕宽度。我希望它向左移动(平移),因此它的右侧最终与其父级(屏幕)的右侧对齐。
.______. .______.
| | | |
|............... ................
. image . --> . image .
................ ................
|______| |______|
mv_anim.xml
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:toXDelta="-100%p"
android:duration="50000"
android:repeatMode="reverse"
android:repeatCount="infinite">
</translate>
</set>
我想我可以通过代码将toXDleta 设置为-(imageWidth - screenWidth) 来做到这一点。
但我想保持一切简单,根本不使用代码。有没有更简单的方法来实现这一点,只使用 XML 动画文件?
【问题讨论】:
标签: android alignment android-animation translate-animation