Android - 设置ImageView的位置sdk 10

时间:2014-04-09 18:01:38

标签: android view position imageview setx

有人可以告诉我如何编写此代码→" ImageView1.setX(ImageView1.getX() - 1)"使用sdk 10(Android版本2.3.6或更低版本)因为" setX"和" getX"是与sdk 11。

2 个答案:

答案 0 :(得分:0)

要获取ImageView的位置,我会使用View.getLocationInWindow()和/或View.getLocationOnScreen()。探索LayoutParams以设置ImageView的位置。请参阅:Set the absolute position of a view

答案 1 :(得分:0)

很明显,Set the absolute position of a view只是缩小了图片而不是视图,我无法用这个来滚动ImageView。