I have a listview with user-filled information. I need every item to be selected. But if I specify R.layout.simple_list_item_single_choice as the markup, the lines are not fully displayed. Moreover, if R.layout.simple_list_item_1 used as a markup, the lines will be fully visible. Is there any method or layout that layout this? Or just use custom lists?

<code> R.layout.simple_list_item_1 </ code> <code> R.layout.simple_list_item_single_choice </ code>

    1 answer 1

    This is what R.layout.simple_list_item_single_choice looks like:

     <CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" android:layout_width="match_parent" android:layout_height="?android:attr/listPreferredItemHeightSmall" android:textAppearance="?android:attr/textAppearanceListItemSmall" android:gravity="center_vertical" android:checkMark="?android:attr/listChoiceIndicatorSingle" android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" /> 

    And here is R.layout.simple_list_item_1:

     <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceListItemSmall" android:gravity="center_vertical" android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:minHeight="?android:attr/listPreferredItemHeightSmall" /> 

    As you can see, in the first case, the height is limited by the parameter

    ?android:attr/listPreferredItemHeightSmall

    Those. To solve your question , simply write your markup with the same code, but without height restrictions.