滚动视图 - 无法向下滚动

Scroll View- Not able to scroll to down

我正在设计一个包含教育信息的布局文件,早期的信息不适合屏幕,所以我添加了滚动视图。我可以向下滚动屏幕,但不能完全向下滚动。我尝试将滚动视图放在所有相关布局的顶部,但它没有完全滚动,我尝试了 enter link description here 但无法解决我的问题。

需要帮助吗?

fragment_education.xml

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/slide_title"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="@dimen/slide_title"
        android:background="@color/Blue"
        android:paddingLeft="@dimen/slide_title">

        <RelativeLayout
            android:id="@+id/be_details"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp">

            <TextView
                android:id="@+id/be_year"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="2016"
                android:textSize="@dimen/slide_title"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/college"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/slide_title"
                android:layout_toRightOf="@+id/be_year"
                android:text="SKIT,Banglore"
                android:textSize="20dp"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/course"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/college"
                android:layout_marginLeft="@dimen/slide_title"
                android:layout_toRightOf="@+id/be_year"
                android:text="@string/course_detail"
                android:textColor="@color/lighter"
                android:textSize="20sp" />

        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/th12_detail"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/be_details"
            android:layout_marginTop="@dimen/slide_title">

            <TextView
                android:id="@+id/th12_year"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="2012"
                android:textSize="@dimen/slide_title"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/th12_college"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/slide_title"
                android:layout_toRightOf="@+id/th12_year"
                android:text="SLIC,Rampur"
                android:textSize="20dp"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/th12_course"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/th12_college"
                android:layout_marginLeft="@dimen/slide_title"
                android:layout_toRightOf="@id/th12_year"
                android:text="@string/th12_details"
                android:textColor="@color/lighter"
                android:textSize="20sp" />
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/school_detail"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/th12_detail"
            android:layout_marginTop="@dimen/slide_title">

            <TextView
                android:id="@+id/scl_year"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="2010"
                android:textSize="@dimen/slide_title"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/scl_school"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/slide_title"
                android:layout_toRightOf="@+id/scl_year"
                android:text="SRHS,Tanda"
                android:textSize="20dp"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/scl_detail"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/scl_school"
                android:layout_marginLeft="@dimen/slide_title"
                android:layout_toRightOf="@id/scl_year"
                android:text="@string/school_details"
                android:textColor="@color/lighter"
                android:textSize="20sp" />


        </RelativeLayout>
    </RelativeLayout>


</ScrollView>

哪里做错了?

从 ScrollView 之后的第一个 RelativeLayout 中删除 android:layout_marginBottom="@dimen/slide_title"android:layout_marginTop="@dimen/slide_title",它将起作用

解决方案唯一要做的就是在滚动视图中添加一个嵌套的滚动视图,这里是工作代码:

        <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
             <android.support.v4.widget.NestedScrollView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:padding="10dp">
                <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="@dimen/slide_title"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="@dimen/slide_title"
                android:background="@color/Blue"
                android:paddingLeft="@dimen/slide_title">
                <RelativeLayout
                    android:id="@+id/be_details"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp">
                    <TextView
                        android:id="@+id/be_year"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="2016"
                        android:textSize="@dimen/slide_title"
                        android:textStyle="bold" />
                    <TextView
                        android:id="@+id/college"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/slide_title"
                        android:layout_toRightOf="@+id/be_year"
                        android:text="SKIT,Banglore"
                        android:textSize="20dp"
                        android:textStyle="bold" />

                    <TextView
                        android:id="@+id/course"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/college"
                        android:layout_marginLeft="@dimen/slide_title"
                        android:layout_toRightOf="@+id/be_year"
                        android:text="@string/course_detail"
                        android:textColor="@color/lighter"
                        android:textSize="20sp" />

                </RelativeLayout>

                <RelativeLayout
                    android:id="@+id/th12_detail"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/be_details"
                    android:layout_marginTop="@dimen/slide_title">
                    <TextView
                        android:id="@+id/th12_year"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="2012"
                        android:textSize="@dimen/slide_title"
                        android:textStyle="bold" />
                    <TextView
                        android:id="@+id/th12_college"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/slide_title"
                        android:layout_toRightOf="@+id/th12_year"
                        android:text="SLIC,Rampur"
                        android:textSize="20dp"
                        android:textStyle="bold" />
                    <TextView
                        android:id="@+id/th12_course"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/th12_college"
                        android:layout_marginLeft="@dimen/slide_title"
                        android:layout_toRightOf="@id/th12_year"
                        android:text="@string/th12_details"
                        android:textColor="@color/lighter"
                        android:textSize="20sp" />
                </RelativeLayout>
                <RelativeLayout
                    android:id="@+id/school_detail"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/th12_detail"
                    android:layout_marginTop="@dimen/slide_title">
                    <TextView
                        android:id="@+id/scl_year"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="2010"
                        android:textSize="@dimen/slide_title"
                        android:textStyle="bold" />
                    <TextView
                        android:id="@+id/scl_school"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="@dimen/slide_title"
                        android:layout_toRightOf="@+id/scl_year"
                        android:text="SRHS,Tanda"
                        android:textSize="20dp"
                        android:textStyle="bold" />
                    <TextView
                        android:id="@+id/scl_detail"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@+id/scl_school"
                        android:layout_marginLeft="@dimen/slide_title"
                        android:layout_toRightOf="@id/scl_year"
                        android:text="@string/school_details"
                        android:textColor="@color/lighter"
                        android:textSize="20sp" />
                  </RelativeLayout>
              </RelativeLayout>
            </android.support.v4.widget.NestedScrollView>
        </ScrollView>