Skip to content Skip to sidebar Skip to footer

Scrollview Inside A Fragment With Tablayout Is Not Scrolling, Why?

im a noob in android development and i was in a introduction course of Cryptography so i decide combine both and make this app. I use a TabLayout for making a tab for each cipher m

Solution 1:

The main problem is in your main_activity.xml. Try to copy this layout that I got from chrisbanes' project and let's see what happens:

<?xml version="1.0" encoding="utf-8"?><android.support.design.widget.CoordinatorLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"android:id="@+id/main_content"android:layout_width="match_parent"android:layout_height="match_parent"><android.support.design.widget.AppBarLayoutandroid:id="@+id/appbar"android:layout_width="match_parent"android:layout_height="wrap_content"android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"><android.support.v7.widget.Toolbarandroid:id="@+id/toolbar"android:layout_width="match_parent"android:layout_height="?attr/actionBarSize"android:background="?attr/colorPrimary"app:popupTheme="@style/ThemeOverlay.AppCompat.Light"app:layout_scrollFlags="scroll|enterAlways" /><android.support.design.widget.TabLayoutandroid:id="@+id/tabs"android:layout_width="match_parent"android:layout_height="wrap_content" /></android.support.design.widget.AppBarLayout><android.support.v4.view.ViewPagerandroid:id="@+id/viewpager"android:layout_width="match_parent"android:layout_height="match_parent"app:layout_behavior="@string/appbar_scrolling_view_behavior" /><android.support.design.widget.FloatingActionButtonandroid:id="@+id/fab"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="end|bottom"android:layout_marginRight="24dp"android:layout_marginBottom="24dp"app:fabSize="normal"app:borderWidth="0dp"app:elevation="6dp"android:src="@drawable/ic_done"/></android.support.design.widget.CoordinatorLayout>

In some cases, using ScrollView within CoordinatorLayout may cause the screen is unable to scroll. So use NestedScrollView instead.

Post a Comment for "Scrollview Inside A Fragment With Tablayout Is Not Scrolling, Why?"