我想要做的是創建一個窮人版本的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座標的方法。