另一個imageview的頂部這是我的佈局,我到目前爲止已經試過沒有任何成功如何下的ImageView在安卓
<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>
我究竟想要的是有我inside_imageview的頂部outside_imageview具有確切高度和寬度...如何通過佈局來做到這一點?
你嘗試加入layout_alignLeft =「@ id/inside_imageview「除了alignTop? – CSmith 2012-08-14 20:04:17
@CSmith是的,我嘗試過。 – 2012-08-14 20:10:56
問題是他有一個LinearLayout裏面的inside_imageView,所以'layout_alignTop'屬性看不到'inside_imageView'的引用ID。如果ID引用是「lltest」,則「outside_imageview」將與LinearLayout對齊。 – DeeV 2012-08-14 20:18:20