2011-05-04 56 views
0

我正在尋找一種方法來設置我的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> 

感謝

+0

你是什麼意思的座標(我猜在屏幕上的位置)?你在使用哪種佈局? – Sephy 2011-05-04 07:36:04

+0

是的,我的意思是屏幕上的位置。它是一個可滾動的圖像。在相對佈局。 – bebe 2011-05-04 07:43:39

+0

你的圖像比X軸和Y軸上的屏幕大嗎? – Sephy 2011-05-04 07:52:40

回答

0

我不知道正確理解你,但是從我得到你的問題,this question可能只是給你回答你正在尋找...

編輯

我不認爲RelativeLayout被設計來處理這種行爲,也許你應該看看Framelayout這實際上是支持視圖疊加的設計。

+0

不,這不是我的意思。我有一個圖像(img1),我有另一個圖像(img2)ON img1。我試圖將img2放置在img1的某個位置,因爲我必須在img1上放置其他圖像。 – bebe 2011-05-04 07:52:50

+0

我有同樣的問題@bebe你找到了解決方案嗎? – Luciano 2012-03-19 09:19:04