Failed to load fragments when tabs + viewpager inside scrollview?

Using the design tablayout + viewpager material the tablayout material everything works fine, but if I try to set the parent view as ScrollView so that the whole screen can scroll once when the user tries to see the contents of the tab fragments, because the fragment contains a listview, so it becomes very low on small ones devices. After adding scrollview my fragments of viewpager are not displayed? How to overcome in this situation?

<?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" android:layout_width="match_parent" android:layout_height="wrap_content" android:fillViewport="true"> <android.support.design.widget.CoordinatorLayout android:id="@+id/tabanim_maincontent" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:id="@+id/tabanim_appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support.design.widget.TabLayout android:id="@+id/tabanim_tabs" android:layout_width="match_parent" android:layout_height="wrap_content" /> </android.support.design.widget.AppBarLayout> <android.support.v4.view.ViewPager android:id="@+id/tabanim_viewpager" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> </android.support.design.widget.CoordinatorLayout> </ScrollView> 

I tried to use CoOrdinator without layout, none of them work

+5
android android-viewpager android-tablayout android-coordinatorlayout
Aug 29 '15 at 16:05
source share

No one has answered this question yet.

See similar questions:

45
CoordinatorLayout using ViewPager RecyclerView

or similar:

740
Dilemma: when to use Fragments vs Activities:
702
How to determine when a fragment becomes visible in ViewPager
462
ViewPager and fragments - what is the right way to store fragment state?
313
LinearLayout not expandable inside ScrollView
249
Replace fragment inside ViewPager
215
Extracting a fragment from ViewPager
175
Android.app Snippets vs android.support.v4.app using ViewPager?
119
Getting current fragment instance in viewpager
fifty
"RuntimeException: native font cannot be created" when loading a font
7
Disable tabs in TabLayout



All Articles