本文介绍了拖放布局的Android 2.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有可能增加一个布局在gestureOverlay视图和拖动的机器人所需的位置放下它。我可以添加一个布局,但不能拖放it..I想知道的是有可能做到这一点在2.2版本?
Is it possible to add a layout in a gestureOverlay view and Drag Drop it in a desired position in android. I am able to add a layout but not able to drag and drop it..I want to know is it possible to do this in version 2.2?
推荐答案
感谢您的帮助......我自己找到了一个解决这个问题......我无法实现这一布局的拖累,但我在这样的调整的方式,布局将开始在那里我接触到屏幕上的位置...感谢....
thanks for the help... myself found a solution for this problem... i couldn't implement a drag on this layout, But i adjust in such a way that the layout will come into the position where i touch on the screen... thanks....
private void RunAnimations(MotionEvent event) {
lastX = event.getX();
lastY = event.getY();
Animation b = new TranslateAnimation(Animation.ABSOLUTE,lastX,Animation.ABSOLUTE,event.getX(),Animation.ABSOLUTE,lastY-57,Animation.ABSOLUTE,event.getY()-57);
rl.startAnimation(b);
b.setFillAfter(true);
}
这篇关于拖放布局的Android 2.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!