2

My ListView does not receive onScroll events in case it is short and does not fill the whole screen, which is strange, because I have set fill_parent as height. My layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_login_screen3"
android:orientation="vertical" >



<CheckBox
    android:id="@+id/overview_allcars_checkbox"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:text="@string/all_cars"
    android:textSize="14sp" />

<LinearLayout
    android:id="@+id/list_root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ListView
        android:id="@+id/android:list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:cacheColorHint="#00000000"
        android:fadingEdge="horizontal"
        android:scrollingCache="true" />
</LinearLayout>
</LinearLayout>
slezadav
  • 6,104
  • 7
  • 40
  • 61

1 Answers1

0

You may find this answer useful:-

Making TextView scrollable on Android

Thats what helped me there:

<ScrollView
android:id="@+id/SCROLLER_ID"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:fillViewport="true">

    <TextView
    android:id="@+id/TEXT_STATUS_ID"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="1.0"/>

</ScrollView>

Mainly you wrap your TextView in a ScrollView.

Community
  • 1
  • 1
  • I have no TextView I have a ListView and it is a bad idea to put ListView inside a ScrollView. Moreover it would not help me trigger onScrollListener on ListView. – slezadav Dec 20 '12 at 19:37
  • You're answer is unrelated to the question – timemanx Oct 07 '13 at 20:12