我想要做的是创建一个穷人版本的GPS地图。我已经设置了一个“地图”图片作为AbsoluteLayout的背景,然后创建了一个需要移动到不同坐标的小型20x20方形图片。我如何着手在Java代码中做这件事?ImageView内的AbsoluteLayout,如何设置ImageView的x,y坐标?
<AbsoluteLayout
android:id="@+id/llMapContainer"
android:layout_width="match_parent"
android:layout_height="390dp"
android:layout_x="0dp"
android:layout_y="44dp"
android:background="@drawable/a4000vert"
android:orientation="vertical" >
<ImageView
android:id="@+id/imgLocation"
android:layout_width="20px"
android:layout_height="20px"
android:layout_x="312px"
android:layout_y="300px"
android:src="@drawable/location" />
</AbsoluteLayout>
我有这个安装在我的Java文件: IV =(ImageView的)findViewById(R.id.imgLocation);
但现在我似乎无法找到任何允许我设置x和y坐标的方法。