在一個相關圖層中,基於您的xml文件將圖像級聯在另一個圖層上。你如何指出最上面的圖像應該是什麼?Android - RelativeLayout問題
有沒有辦法在代碼而不是xml中做到這一點?
我附上我的XML文件,以供參考:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<ImageView
android:id="@+id/img1"
android:src="@drawable/payarrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageView
android:id="@+id/img2"
android:src="@drawable/chargearrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ImageView
android:id="@+id/landingDockLeft"
android:src="@drawable/landingdock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ImageView
android:id="@+id/landingDockRight"
android:src="@drawable/landingdock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
「RelativeLayout」中的最後一個視圖將成爲最頂層的視圖 – binnyb