0
为什么即使布局:高度与它的父级匹配,以下布局中的灰色框(transaction_amount)也不会展开为可用的全部空间。相对布局中的TextView不扩展以填充可用空间
<TextView android:id="@+id/transaction_amount"
android:layout_width="120dp"
android:layout_height="match_parent"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Large"
android:textColor="@android:color/primary_text_light"
android:background="@drawable/rounded_rectangle"
tools:text="100"/>
<TextView
android:id="@+id/transaction_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/transaction_amount"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"
android:textColor="@android:color/secondary_text_light"
tools:text="Mast Kalandar Dinner"/>
<TextView
android:id="@+id/shared_bw_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@id/transaction_name"
android:layout_toRightOf="@+id/transaction_amount"
android:layout_below="@id/transaction_name"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
android:textColor="@android:color/secondary_text_light_nodisable"
android:text="Shared Between"/>
<TextView
android:id="@+id/shared_bw_csv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/shared_bw_label"
android:layout_alignBaseline="@id/shared_bw_label"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
android:textColor="@android:color/secondary_text_light_nodisable"
tools:text="Ashu, Amol"/>
尝试改变高度match_parent – CENT1PEDE 2014-09-28 19:52:53
在你提到你做的“宽度” match_parent你的问题,但空的空间被引起高度的,那么你应该通过改变高度解决问题。 – CENT1PEDE 2014-09-28 19:55:32
抱歉,我打算编写layout_height。在代码中,layout_height是match_parent – 2014-09-28 20:30:45