2012-07-13 27 views
7

Ben sormak için oldukça basit bir soru var: Ben ekranın sağ alt alanında, bir ImageView büyük ekran tüm ekranda küçük bir logo koymak gerekir, ama nasıl bilmiyorum Koordinatları veya ImageView'ların göreceli bir konumda olmasını söyleme. BöyleAndroid, ImageView üzerinde ImageView

şey:

enter image description here

+0

FrameLayout'a bakabilirsiniz. [Heres] (http://mobileorchard.com/android-app-development-%E2%80%93-layouts-part-three-frame-layout-and-scroll-view/) iyi bir bağlantı, umarım size yardımcı olur . – Antrromet

cevap

8

bu

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" > 

    <ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentTop="true" 
     android:src="@drawable/ic_launcher" /> 

    <ImageView 
     android:id="@+id/imageView2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentRight="true" 
     android:src="@drawable/ic_launcher" /> 

</RelativeLayout> 

Çıktı

enter image description here

+0

Bunu denedim ve ilk denemede denedim – Stefano

+0

'RelativeLayout' anahtar! doğrusal düzen kullanıyordum. – ThunderWiring

2

Kullan FrameLayout deneyin.

enter image description here

Hemen ihtiyaçlarınıza göre çimdik çıkış

aşağıdaki verecek tarihinde Blogspot Numune

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

    <ImageView 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 

     android:scaleType="center" 
     android:src="@drawable/golden_gate" /> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginBottom="20dip" 
     android:layout_gravity="center_horizontal|bottom" 

     android:padding="12dip" 

     android:background="#AA000000" 
     android:textColor="#ffffffff" 

     android:text="Golden Gate" /> 

</FrameLayout> 

gereğince

.