我需要移动的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);