Qing
Qing

Reputation: 1411

firstVisibleItem, visibleItemCount, totalItemCount do not change even Scroll event happened

Im having a ScrollView which contains a Listview, However even if I scroll the listview, the three parameters in onscroll() method do not change, they remain the same as the initial state.

Here's my layout

enter image description here

Also my code for handling the scroll event,noted the contentlist is the listview not the scrollview.

enter image description here

However as you can see in the logcat, nothing change even if i scroll around and the visible item count should be two only

enter image description here

enter image description here

I wonder if its because of the height of the listview which cause this issue?

Thanks

Upvotes: 0

Views: 557

Answers (1)

Lamorak
Lamorak

Reputation: 11137

Having ListView inside of a ScrollView always cause problems.. Why don't you just have the ListView in the SwipeRefreshLayout and use addHeaderView() to display your LinearLayout above it?

Upvotes: 1

Related Questions