【发布时间】:2011-09-28 12:00:14
【问题描述】:
我试图有一个复杂的 ListView,它在左侧有一个标题和描述,在右侧有一个复选框。我正在这样做,但左侧的文本超出了右侧的复选框。
我怎样才能防止这种情况发生?
我的布局代码目前看起来像:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:paddingTop="10dip"
android:paddingBottom="10dip"
android:paddingLeft="15dip">
<CheckBox
android:id="@+id/list_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:checked="false"
/>
<TextView
android:text="Some Title"
android:id="@+id/list_complex_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/list_checkbox"
android:textAppearance="?android:attr/textAppearanceLarge"
/>
<TextView
android:text="Some long description Some long description Some long description Some long description Some long description."
android:id="@+id/list_complex_caption"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#98AFC7"
android:layout_below="@+id/list_complex_title"
android:textAppearance="?android:attr/textAppearanceSmall"
/>
</RelativeLayout>
不幸的是,我是该网站的新手,需要更多积分才能发布图片:(
如果可能,我也希望复选框垂直居中。
任何布局专家?
【问题讨论】: