Infinite animation of imageview android

℡╲_俬逩灬. 提交于 2019-12-08 06:07:34

问题


This is just a continuation of my unsolved question which can be found here: Animate ImageView

For now, I managed to make the imageviews move using

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator">
<translate
android:fromXDelta="-100%p"
android:toXDelta="0%"
android:duration="2000"/>
</set>

But what I want to accomplish is the images should accelerate from left to right and when they reach the end, they should re-appear on the activity again.

Any help and suggestion are truly appreciated. Thanks.


回答1:


To repeat animation put:

android:repeatCount="-1"

If you wanna imageView reappear from right to left put:

android:repeatMode="reverse"



回答2:


You should use SurfaceView instead of moving ImageViews.



来源:https://stackoverflow.com/questions/16399630/infinite-animation-of-imageview-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!