我建议使用相对布局。您可以相对于其他视图或父视图放置复选框,例如,如果您想将其放置在右侧和 TextView 下方,您可以使用类似
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/textview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Text"
/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/textview"
/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
另请查看 droiddraw.org,但我建议您自己编写代码,因为如果您需要编辑/重复使用,它可以加快流程。
有关RelativeLayout的更多信息,请参阅http://d.android.com/reference/android/widget/RelativeLayout.html
| 归档时间: |
|
| 查看次数: |
5646 次 |
| 最近记录: |