问题
using material design tablayout +viewpager material design tablayout everything works perfectly but if i m trying to put parent view as ScrollView so that my whole screen can scroll once user try to see tabs fragment content as fragment contains listview so it is getting very low height on small devices.After adding scrollview my fragments of viewpager are not being 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 have tried with and without CoOrdinator layout none of them working
来源:https://stackoverflow.com/questions/32288013/failed-to-load-fragments-when-tabs-viewpager-inside-scrollview