我聽說我的XML佈局是可怕分層。我還能如何安排它?這裏是什麼,我想我的佈局看起來像一個畫面:如何更有效地安排我的AXML佈局?
是否有可能放置在同一版面的圖像和的ImageButton S'
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:p1="http://schemas.android.com/apk/res/android"
p1:layout_width="match_parent"
p1:layout_height="match_parent"
p1:id="@+id/relativeLayout1"
p1:background="@drawable/pickcitybackground">
<RelativeLayout
p1:minWidth="25px"
p1:minHeight="25px"
p1:layout_width="229.0dp"
p1:layout_height="217.0dp"
p1:id="@+id/relativeLayout2"
p1:paddingTop="90dp"
p1:gravity="center">
<ImageView
p1:src="@drawable/Pick"
p1:layout_width="120dp"
p1:layout_height="120dp"
p1:id="@+id/pick"
p1:background="#02ffffff"
p1:scaleType="centerCrop" />
</RelativeLayout>
<RelativeLayout
p1:minWidth="25px"
p1:minHeight="25px"
p1:layout_width="331.5dp"
p1:layout_height="217dp"
p1:id="@+id/relativeLayout3"
p1:paddingTop="90dp"
p1:gravity="right">
<ImageButton
p1:src="@drawable/austinButton"
p1:layout_width="120dp"
p1:layout_height="120dp"
p1:id="@+id/austinButton"
p1:background="#02ffffff"
p1:scaleType="centerCrop" />
</RelativeLayout>
<RelativeLayout
p1:minWidth="25px"
p1:minHeight="25px"
p1:layout_width="229dp"
p1:layout_height="match_parent"
p1:id="@+id/relativeLayout4"
p1:paddingTop="15dp"
p1:gravity="center">
<ImageButton
p1:src="@drawable/nashvilleButton"
p1:layout_width="120dp"
p1:layout_height="120dp"
p1:id="@+id/nashvilleButton"
p1:scaleType="centerCrop"
p1:background="#02ffffff" />
</RelativeLayout>
<RelativeLayout
p1:minWidth="25px"
p1:minHeight="25px"
p1:layout_width="331.5dp"
p1:layout_height="match_parent"
p1:id="@+id/relativeLayout5"
p1:gravity="right"
p1:paddingTop="265dp">
<ImageButton
p1:src="@drawable/newyorkButton"
p1:layout_width="120dp"
p1:layout_height="120dp"
p1:id="@+id/newyorkButton"
p1:background="#02ffffff"
p1:scaleType="centerCrop" />
</RelativeLayout>
<RelativeLayout
p1:minWidth="25px"
p1:minHeight="25px"
p1:layout_width="229dp"
p1:layout_height="match_parent"
p1:id="@+id/relativeLayout6"
p1:gravity="center"
p1:paddingTop="350dp">
<ImageButton
p1:src="@drawable/sanfranButton"
p1:layout_width="120dp"
p1:layout_height="120dp"
p1:id="@+id/sanfranButton"
p1:background="#02ffffff"
p1:scaleType="centerCrop" />
</RelativeLayout>
<RelativeLayout
p1:minWidth="25px"
p1:minHeight="25px"
p1:layout_width="331.5dp"
p1:layout_height="match_parent"
p1:id="@+id/relativeLayout7"
p1:gravity="right"
p1:paddingTop="435dp">
<ImageButton
p1:src="@drawable/seattleButton"
p1:layout_width="120dp"
p1:layout_height="120dp"
p1:id="@+id/seattleButton"
p1:background="#02ffffff"
p1:scaleType="centerCrop" />
</RelativeLayout>
你爲什麼選擇使用'p1:'而不是'android:'? –
我在Xamarin Studio中使用了Android Designer,這就是它自動使用的。有什麼不同?我想知道! –
oww ...我從不使用xamarin,但'android:'是Java/Android Studio中的默認約定。 –