Android 滚动视图-无法向下滚动

Android 滚动视图-无法向下滚动,android,android-fragments,android-scrollview,android-relativelayout,Android,Android Fragments,Android Scrollview,Android Relativelayout,一、 我正在设计一个包含教育信息的布局文件,以前的信息不适合屏幕,所以我添加了滚动视图。我可以向下滚动屏幕,但不能完全滚动。我尝试将scrollView放在所有相关布局的顶部,但它没有完全滚动,我尝试了,但无法解决我的问题 需要帮助吗 fragment_education.xml 我哪里做错了?删除android:layout\u marginBottom=“@dimen/slide\u title”和android:layout\u marginTop=“@dimen/slide\u t

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

需要帮助吗

fragment_education.xml



我哪里做错了?

删除
android:layout\u marginBottom=“@dimen/slide\u title”
android:layout\u marginTop=“@dimen/slide\u title”
从ScrollView之后的第一个RelativeLayout开始,它将起作用

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

        <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>

android:fillViewport=“true”在
ScrollView
        <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>