![](/img/trans.png)
[英]Android Layout Animations from bottom to top and top to bottom on ImageView click
[英]Moving imageview from top to bottom in android
我在屏幕中央有一个ImageView,我想向上移动它。 它保持在顶部。 我看到了Tween动画文档,并对其进行了尝试,但无法正常工作。 请问谁能帮助我解决这个问题。
您是否尝试查看动画?
Animation an = new TranslateAnimation(fromX,fromY,toX,toY);//0,0 is the current coordinates
an.setFillAfter(true);// to keep the state after animation is finished
yourView.startAnimation(an);// to start animation obviously
要使其从底部移动到顶部,请获取屏幕高度并使用它来设置“ toY”参数。
经过几次尝试,您一定会做得到。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.