Đây là cách bố trí của tôi mà tôi đã cố gắng cho đến nay không có bất kỳ thành côngLàm thế nào để đặt một ImageView trên đầu trang của một ImageView trong android
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white">
<LinearLayout
android:id="@+id/lltest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_centerHorizontal="true">
<ImageView
android:id="@+id/inside_imageview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:layout_marginBottom="5dip"
android:src="@drawable/frame"/>
</LinearLayout>
<ImageView
android:id="@+id/outside_imageview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/inside_imageview"
android:scaleType="fitXY"/>
</RelativeLayout>
gì tôi chính xác muốn là phải có outside_imageview của tôi trên đầu trang của inside_imageview với chính xác chiều cao và chiều rộng ... Làm thế nào để làm điều đó thông qua bố trí?
bạn đã thử thêm layout_alignLeft = "@ id/inside_imageview "ngoài alignTop? – CSmith
@CSmith Có, tôi đã thử. –
Vấn đề là anh ta có inner_imageView bên trong một LinearLayout vì vậy thuộc tính 'layout_alignTop' không thể thấy ID tham chiếu đến' inner_imageView'. 'external_imageview' sẽ căn chỉnh với LinearLayout nếu tham chiếu ID là' lltest' thay thế. – DeeV