0
我有一个水平的LinearLayout。这个LinearLayout在另一个LinearLayout旁边有一个复选框。复选框的布局宽度/高度是wrap_content,而内部LinearLayout是fill_parent/wrap_content。内部LinearLayout的layout_weight设置为1.问题填充
我试着在复选框周围添加一些android:padding以提供一些空间,但没有填充。我也试过android:paddingLeft/Right/etc。如何在我的复选框周围填充一些填充?
注:我有一个内部的LinearLayout,因为我将增加更多的TextViews
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight">
<CheckBox
android:id="@+id/mycheck"
android:text=""
android:layout_width="30dip"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:focusable="false"
android:background="@drawable/checkbox_background"
android:button="@drawable/checkbox"
/>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="wrap_content">
<TextView
android:id="@+id/mytext"
android:layout_width="fill_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:layout_height="wrap_content"
android:lines="1"
android:textColor="@color/white"
android:textSize="10sp"
android:textStyle="italic"
/>
</LinearLayout>
</LinearLayout>
这一工程的
layout_marginLeft
财产。谢谢 – Andrew 2010-08-10 20:28:31