Scrolling does not work, although I have done it differently before. I did the scroll parent, and linearlayout did the descendant, but still does not work.

<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/colorWhite" android:fillViewport="true" tools:context=".ActivityThree"> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <android.support.v4.view.ViewPager android:id="@+id/slideViewPager" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_marginBottom="40dp"> </android.support.v4.view.ViewPager> <LinearLayout android:id="@+id/dotsLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="false" android:layout_centerInParent="true" android:layout_centerVertical="false" android:orientation="horizontal" android:padding="20dp"> </LinearLayout> </RelativeLayout> </ScrollView> 
  • you most likely touch the pager intercepted, check - Jarvis_J

1 answer 1

Here is your code, changed a couple of parameters:

 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white" android:fillViewport="true" android:orientation="vertical"> <RelativeLayout android:layout_width="match_parent" android:layout_height="2400dp"> <android.support.v4.view.ViewPager android:id="@+id/slideViewPager" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentStart="true" android:layout_alignParentLeft="true" android:layout_alignParentBottom="true" android:layout_marginBottom="40dp"> </android.support.v4.view.ViewPager> <LinearLayout android:id="@+id/dotsLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerInParent="true" android:layout_centerHorizontal="false" android:layout_centerVertical="false" android:orientation="horizontal" android:padding="20dp"> </LinearLayout> </RelativeLayout> </ScrollView> 

PS: 2400dp replace wrap_content when make sure everything is fine. Scroll will not work when the content is enough space.

  • one
    Thank you very much) Everything works) - Alena Sapronova