Проблемы с заполнением

У меня есть горизонтальный LinearLayout. Этот LinearLayout имеет флажок рядом с другим LinearLayout. Ширина/высота макета флажка — wrap_content, тогда как внутренний LinearLayout — fill_parent/wrap_content. Для layout_weight внутреннего LinearLayout установлено значение 1.

Я попытался добавить немного android:padding вокруг флажка, чтобы освободить место вокруг него, но отступы не даны. Я также пробовал android:paddingLeft/Right/etc. Как мне получить отступ вокруг моего флажка?

Примечание. У меня есть внутренний LinearLayout, потому что я буду добавлять больше TextView.

<?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>

person Andrew    schedule 10.08.2010    source источник


Ответы (1)


Попробуйте установить свойство layout_marginLeft второго макета

person Asahi    schedule 10.08.2010