Я попытался использовать marginBottom в listView, чтобы освободить место между элементами listView, но все же элементы соединены вместе.
Возможно ли такое? Если да, есть ли какой-то особый способ сделать это?
Мой код ниже
<LinearLayout
android:id="@+id/alarm_occurences"
android:layout_width="fill_parent"
android:orientation="vertical"
android:layout_height="fill_parent"
android:background="#EEEEFF"
xmlns:android="http://schemas.android.com/apk/res/android">
<ListView
android:id="@+id/occurences"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
Мой настраиваемый элемент списка:
<com.android.alarm.listItems.AlarmListItem
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/alarm_item_background"
android:layout_marginBottom="10dp"
>
<CheckedTextView
android:id="@android:id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:textSize="20sp"
android:textStyle="bold"
android:typeface="serif"
android:padding="10dp"
/>
</com.android.alarm.listItems.AlarmListItem>
Как в этом случае сделать интервал между элементами списка?
Это поможет Вам добавить высоту делителя.
getListView().setDividerHeight(10)
, Если Вы хотите добавить пользовательское представление, можно добавить маленькое представление в самом listView расположении объекта.