我正在尋找一種方法來設置我的imageView座標。我想把其他圖像放在座標上。設置座標圖像查看
ImageView img1 = (ImageView) findViewById(R.id.imageView1);
img1.setAdjustViewBounds(true);
我的佈局是這樣的:
<RelativeLayout android:id="@+id/rellayneuuuu"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageView android:id="@+id/imageView1" android:scaleType="centerCrop"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:src="@drawable/image1" />
<ImageView android:id="@+id/imageView2" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:src="@drawable/icon"
android:layout_marginTop="40px" android:layout_marginLeft="40px" />
</RelativeLayout>
感謝
你是什麼意思的座標(我猜在屏幕上的位置)?你在使用哪種佈局? – Sephy 2011-05-04 07:36:04
是的,我的意思是屏幕上的位置。它是一個可滾動的圖像。在相對佈局。 – bebe 2011-05-04 07:43:39
你的圖像比X軸和Y軸上的屏幕大嗎? – Sephy 2011-05-04 07:52:40