이것은 간단 해 보이지만 Google 검색 인내심을 소진했습니다.LinearLayout 하위가있는 RelativeLayout 부모를 채우십시오.
나는 두 개의 하위가 나란히있는 RelativeLayout
을 가지고 있는데, 두 LinearLayouts의 높이에 상관없이 둘 다 세로로 부모를 채우기를 원합니다. 이 행은 ListView
행으로 사용되고 @ id/item_left 아래의 내용은 일반적으로 오른쪽에있는 것보다 짧습니다.
배경 드로어 블이 전체 행을 채우지 않습니다.
양면 작성에 대한 아이디어가 있으십니까?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent">
<LinearLayout android:id="@+id/item_left"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:paddingRight="2dp"
android:paddingLeft="2dp"
android:background="@drawable/item_left"
android:orientation="vertical">
<TextView android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/item_left_text"
android:text="" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/item_right_background"
android:layout_toRightOf="@id/item_left">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/item_right_text"
android:text="Row1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/item_right_text"
android:text="Row2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/item_right_text"
android:text="Row3" />
</LinearLayout>
</RelativeLayout>
당신이 반 반을 부여 할 수 있습니다 첫 번째 텍스트 뷰의 텍스트를 변경합니다 색상을 변경 양쪽 너비? –
너비는 콘텐츠와 함께 흐르게됩니다. 왼쪽은 오른쪽보다 폭이 훨씬 작습니다. – Kirk
콘텐츠 당 왼쪽 너비가 필요하지만 두 LL 모두 부모를 채워야합니까? –