如何在运动图像应用事件(动画从上到下) [英] how to apply event on moving image(Animating from top to bottom)
本文介绍了如何在运动图像应用事件(动画从上到下)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个例子,在这个自上而下的图像移动到底部和底部到顶部,这是不错,但我的要求是,我想通过点击上移动图像多数民众赞成它产生在屏幕上的一些事件。
请任何一个帮助我。
XML文件: <的FrameLayout
机器人:layout_width =match_parent
机器人:layout_height =406dp
机器人:layout_gravity =底
机器人:背景=@动画/图形> <! - < ImageView的
机器人:ID =@ + ID / androidimage
机器人:layout_width =100dp
机器人:layout_height =100dp
机器人:layout_gravity =底
安卓的onClick =imageButtonClicked
机器人:SRC =@绘制/ Android的
机器人:layout_marginLeft =100dp/> - > <的ImageButton
机器人:ID =@ + ID / androidimage
机器人:layout_width =100dp
机器人:layout_height =100dp
机器人:layout_gravity =底
安卓的onClick =imageButtonClicked
机器人:SRC =@绘制/ Android的
机器人:layout_marginLeft =100dp/> < /&的FrameLayout GT;
解决方案
您需要使用 nineoldandroids库。
使用ObjectAnimator CALSS动画。
i have an example,in this the image moves from top to bottom and bottom to top,this is fine but my requirement is i want to generates some events on the screen by clicking on that moving image thats it . please any one help me.
xml file:
<FrameLayout
android:layout_width="match_parent"
android:layout_height="406dp"
android:layout_gravity="bottom"
android:background="@anim/graphics" >
<!-- <ImageView
android:id="@+id/androidimage"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom"
android:onClick="imageButtonClicked"
android:src="@drawable/android"
android:layout_marginLeft="100dp"/> -->
<ImageButton
android:id="@+id/androidimage"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="bottom"
android:onClick="imageButtonClicked"
android:src="@drawable/android"
android:layout_marginLeft="100dp" />
</FrameLayout>
解决方案
You need to use nineoldandroids library. use ObjectAnimator calss to animate.
这篇关于如何在运动图像应用事件(动画从上到下)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文