I need to show the viewpager (image and text below the image in the pager line) inside the scrollview. I download the image, text from the Internet and show in the lines of the pager. I wrapped the viewpager inside a srollview to support landscape mode.
<com.xxx.myapp.android.ui.CustomScrollView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:fadingEdge="none" android:fillViewport="true" android:gravity="center"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:descendantFocusability="blocksDescendants" android:orientation="vertical" > <android.support.v4.view.ViewPager android:id="@+id/viewPager" android:layout_width="match_parent" android:layout_height="800dp" android:layout_gravity="top" android:layout_marginTop="10dp" /> </LinearLayout> </com.xxx.myapp.android.ui.CustomScrollView>
And here is the CustomScrollView . The problem is how to adjust the height of the presentation pager based on the height of its children so that I can scroll the screen until there is only a pager object. If I set the pager presentation height in wrapcontent, nothing is displayed in the viewpager. If I set 800dp, then I will see the pager elements, but there is no need to scroll on the screen. I do not want the scroll to be scrolled beyond the height of the pager. Please help me.
android android-viewpager android-scrollview
Gayathri
source share