I am trying to get the vertical scroll for a list view but all the time all the list view items are being shown even if this means that they will get out of the phone's display.
This sis the code I have been using:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="25px"
android:minHeight="25px">
<GridLayout
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:rowCount="6"
android:columnCount="1"
android:orientation="vertical"
android:id="@+id/myGridID">
<!-- other controls like TextView, EditBox, other Grid layouts -->
<ListView
android:layout_row="4"
android:layout_column="0"
android:isScrollContainer="true"
android:choiceMode="singleChoice"
android:scrollbarSize="100px"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/myListId" />
<!-- other controls like TextView, EditBox, other Grid layouts -->
</GridLayout>
</LinearLayout>
I expected that when the height of the list's items will be more than 100px (a value bigger than the value from android:scrollbarSize) the vertical scroll will become active. This is not happening.
Using the below code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="25px"
android:minHeight="25px">
<GridLayout
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:rowCount="6"
android:columnCount="1"
android:orientation="vertical"
android:id="@+id/myGridID">
<!-- other controls like TextView, EditBox, other Grid layouts -->
<ScrollView
a:visibility="visible"
xmlns:a="http://schemas.android.com/tools"
android:scrollbars="vertical"
android:visibility="visible"
android:layout_height="150px"
android:layout_row="4"
android:layout_column="0">
<ListView
android:isScrollContainer="true"
android:choiceMode="singleChoice"
android:scrollbarSize="100px"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/myListId" />
</ScrollView>
<!-- other controls like TextView, EditBox, other Grid layouts -->
</GridLayout>
</LinearLayout>
So having the list view put inside a ScrollView was creating a vertical scroll, but all the time only one list item was shown, so also here I was expected to see at least three items from the list view and then to scroll through the rest of the items.
Still I prefer to add the vertical scrolling feature to my app by using only the list view if possible, since the ScrollView seems to complicate things when trying to get a child from the list.
Could someone please explain me what I am doing wrong for the build in vertical scroll of the android xamarin list view ?