[英]Android Java make a image move down
How can i make a image just scroll down a straight line by it self? 我怎样才能使图像自行向下滚动一条直线?
Like 喜欢
The Image starts up here and then it will just smoothly scroll down till it hits the bottom and stop 图像从此处开始,然后平稳地向下滚动直到到达底部并停止
Please look at this: http://tinypic.com/r/1z17iv9/7 请查看以下内容: http : //tinypic.com/r/1z17iv9/7
You should save this TopDownAnim.xml in the anim folder inside resources. 您应该将此TopDownAnim.xml保存在资源内的anim文件夹中。
<translate android:interpolator="@android:anim/accelerate_interpolator"
android:fromXDelta="0" android:toXDelta="0" android:zAdjustment="top"
android:fromYDelta="0%" android:toYDelta="100%" android:duration="1000"/>
And in the code you can use something like 在代码中,您可以使用类似
TranslateAnimation tdAnim = AnimationUtils.loadAnimation(this,
R.anim.TopDownAnim);
view.startAnimation(tdAnim);
Your question is a bit vague, but I think what you're looking for is a ScrollView. 您的问题有点含糊,但我认为您正在寻找的是ScrollView。 Try referring to this documentation .
尝试参考本文档 。 What you want to do is to put the ImageView inside this ScrollView.
您要做的是将ImageView放入此ScrollView中。
EDIT Ah, I see. 编辑啊,我知道了。 I apologize for misunderstanding what you were asking about.
对于您的询问有误会,我深表歉意。 Perhaps you should consider animating the ImageView with some basic view animations.
也许您应该考虑使用一些基本的视图动画为ImageView设置动画。 Try looking at this question .
尝试看这个问题 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.