Is it possible to have a ViewPager inside of a ScrollView?
I've figured it out;
I needed to add android:fillViewport="true"
to the ScrollView element.
ViewPager inside ScrollView not working
Try adding this piece of code before loading your viewPager
NestedScrollView scrollView = (NestedScrollView) findViewById (R.id.nest_scrollview);
scrollView.setFillViewport (true);
Let me know if it helped fix the issue.
ScrollView Inside ViewPager Not Working
I managed to solve a similar vertical scrolling problem in my ViewPager doing the following:
I created a separate layout (content_event) with ViewPager:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/viewPagerActivEvent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
</android.support.v4.view.ViewPager>
</RelativeLayout>And created NestedScrollView enclosing preceding layout with "android:fillViewport" set to true:
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior" >
<include layout="@layout/content_event" >
</android.support.v4.widget.NestedScrollView>
Maybe it's not quite right but worked for me:)
Related Topics
How to Do Circular Scrolling on Viewpager
How to Change Separator Color in Navigationview
Identifying Rtl Language in Android
Display Data After Every 10 Seconds in Android
Android Picasso Library, How to Add Authentication Headers
Android: Simulate Wifi in the Emulator
Noclassdeffounderror at Google Play Services V2 Library
I Have Forgotten My Keystore Password and I Want to Install My APK on Google Play. What Do I Do
How to Connect SQL Server Using Jtds Driver in Android
Immersive Mode Navigation Becomes Sticky After Volume Press or Minimise-Restore
Android Spannablestring Set Background Behind Part of Text
Measuring a View Before Rendering It
Render Error in Android Studio 3.0 Layout Editor
Get the Distance Between Two Locations in Android
Fire a Pinch In/Out Command to Android Phone Using Adb