4

why my scrollView not scrolling until the end of view? while at the bottom there is more text. So every I scrolling just up there, not until the end, like in the pictures on the red mark pict

And This is my layout code

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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="match_parent">
    <android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|enterAlways"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

    </android.support.design.widget.AppBarLayout>
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:orientation="vertical" android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="55dp">

            <!-- Label -->

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="8dip"
                android:text="Jenis Cetakan"
                android:id="@+id/textview_jenis_cetakan_banner"/>

            <!-- Spinner Dropdown -->

            <Spinner
                android:id="@+id/jenis_cetakan_banner"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="8dip"
                android:layout_marginRight="8dip"
                android:layout_marginTop="10dip"
                android:entries="@array/jenis_cetakan" />

            <!-- Select Label -->

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="8dip"
                android:text="Jenis Kertas"
                android:id="@+id/textview_jenis_kertas_banner"
                android:visibility="gone"/>

            <!-- Spinner Dropdown -->
            <Spinner
                android:id="@+id/jenis_kertas_banner"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dip"
                android:layout_marginLeft="8dip"
                android:layout_marginRight="8dip"
                android:visibility="gone"/>

            <!-- Select Label -->

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:padding="8dip"
                android:text="Ukuran Banner"
                android:id="@+id/textview_ukuran_banner"
                android:visibility="gone"/>

            <!-- Spinner Dropdown -->
            <Spinner
                android:id="@+id/ukuran_banner"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dip"
                android:layout_marginLeft="8dip"
                android:layout_marginRight="8dip"
                android:visibility="gone"/>

            <Space
                android:layout_width="wrap_content"
                android:layout_height="20dp" />
            <!--edittext harga per meter -->

            <android.support.design.widget.TextInputLayout
                android:id="@+id/input_layout_harga_banner"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <EditText
                    android:id="@+id/harga_banner"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Masukkan Harga Banner (per meter)"
                    android:visibility="gone"
                    android:inputType="number"/>

            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:id="@+id/input_layout_lama_pengerjaan_banner"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <EditText
                    android:id="@+id/lama_pengerjaan_banner"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Masukkan lama Pengerjaan (dalam hari)"
                    android:visibility="gone"
                    android:inputType="number"/>

            </android.support.design.widget.TextInputLayout>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="aaa"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="aaa"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="aaa"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="aaa"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="aaa"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="aaa"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="aaa"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="aaa"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="aaa"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="aaa"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="aaa"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="aaa"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="bbb"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="bbb"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="bbb"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="bbb"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="bbb"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="bbb"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="bbb"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="bbb"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="bbb"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="ccc"/>



        </LinearLayout>
    </ScrollView>
</android.support.design.widget.CoordinatorLayout>
Eggy Sudianto
  • 277
  • 3
  • 15
  • try using android:paddingBottom="10dp" in scrollview, also refer to http://stackoverflow.com/questions/15131962/scrollview-doesnt-scroll-to-the-bottom – chirag90 Mar 23 '17 at 14:02
  • Helpful link : http://stackoverflow.com/questions/27739055/android-scrollview-is-not-scrolling – buzzingsilently Mar 23 '17 at 14:07
  • remove scroll flag from toolbar – Jaydeep Devda Mar 23 '17 at 14:07
  • @chirag90 great! if you want me to mark your correct answer, please answer it – Eggy Sudianto Mar 23 '17 at 14:08
  • Although applying padding will solve your issue, but it's not a bulletproof workaround. You can't be sure it will work on each device configuration. Just out of curiosity, can you say what styles does your activity have? – azizbekian Mar 23 '17 at 14:13
  • @EggySudianto You can solve this by Adding an empty view at the end. Refer my answer for another question - https://stackoverflow.com/questions/30282580/scrollview-not-scrolling-android/46359834#46359834 – Akshatha S R Mar 15 '19 at 12:23

1 Answers1

3

Add android:paddingBottom="10dp" in scrollview. I found the answer from Older thread

chirag90
  • 2,211
  • 1
  • 22
  • 37