Search code examples
androidscrollandroid-viewpagerscrollviewandroid-scrollview

Android: Vertical ScrollView inside a ViewPager -- unable to scroll


In my app, I have a ViewPager which contains 4 pages. The root element of two of those pages is a ScrollView. My problem is that I can perfectly scroll the ScrollView on my 4.2 Android Phone, but on my 2.3 Android Phone I can't.

So inside the ScrolView there are cliclable Views... I can click on them, but if I move my finger on it up and down the ScrollView doesn't gets scrolled. If I move my finger on the screen where there is only the ScrollView, it scrolls. Why is this? If I simply use the ScrollView layout without the ViewPager around it, the scrolling works perfectly on a 2.x and also on a 4.x Android Phone.


Solution

  • Actually it was my fault. The simple ScrollView works perfectly inside a ViewPager. I have a ListView inside another ViewPager and there I had to make some tricks to make the ListView works, and from this I thought that I have to make the same tricks with the ScrollView too. But I didn't, and that was the problem.