移动ImageView的内部RelativeLayout的身边 [英] Move ImageView around inside RelativeLayout
本文介绍了移动ImageView的内部RelativeLayout的身边的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要移动的ImageView的(或者别的什么,对这个问题)围绕内RelativeLayout的。是否有任何人知道正确的方式做到这一点?
I need to move an ImageView (or anything else, for that matter) around inside a RelativeLayout. Does any one know the proper way to do this?
推荐答案
Makesure的的ImageView 的的 layout_height 和 layout_width 设置为 FILL_PARENT 。然后做:
Makesure ImageView's layout_height and layout_width is set to fill_parent. Then do:
要移动视图,使用的矩阵的。这是非常方便的。
To move a view, use Matrix. It is very handy.
Matrix matrix = new Matrix();
matrix.reset();
matrix.postTranslate(x, y);
imageview.setScaleType(ScaleType.MATRIX);
imageview.setImageMatrix(matrix);
这篇关于移动ImageView的内部RelativeLayout的身边的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文