我在爲我的活動設置佈局時遇到困難。我試圖實現一個列表佈局,列表中的每一行都包含圖標,每個圖標旁邊有兩個EditText視圖。Android佈局:每行一個圖像和兩個EditText視圖
例如,GMail圖標,用戶可以在視圖中輸入他們的電子郵件和密碼。
我試過兩種方法,似乎無法得到一個工作。我最近來的是每行一個EditText視圖,但這不是我想要實現的。
下面看看我的xml。如果任何人有任何建議,我該如何改善這將是偉大的。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp" >
<RelativeLayout >
<ImageView
android:id="@+id/logo"
android:layout_width="150px"
android:layout_height="150px"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:src="@drawable/gm" >
</ImageView>
<EditText
android:id="@+id/secondLine"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignRight="@id/logo"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
>
</EditText>
<EditText
android:id="@+id/firstLine"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignRight="@id/logo"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_above="@id/secondLine">
</EditText>
</RelativeLayout>
</LinearLayout>
你看過的文章[佈局技巧:建立高效的佈局(http://developer.android.com/resources/articles/layout-tricks-efficiency.html)。它有一個例子,聽起來像你想要做的。 –