Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/195.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ScrollView在布局活动的底部留有额外的空间-android_Android_Android Layout_Android Recyclerview_Android Scrollview - Fatal编程技术网

ScrollView在布局活动的底部留有额外的空间-android

ScrollView在布局活动的底部留有额外的空间-android,android,android-layout,android-recyclerview,android-scrollview,Android,Android Layout,Android Recyclerview,Android Scrollview,我的滚动视图在一些布局下留下了空间 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"

我的
滚动视图
在一些
布局下留下了空间

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#efefef">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        style="@style/CustomToolbar"
        android:layout_width="match_parent"
        android:layout_height="?actionBarSize"
        android:layout_alignParentTop="true">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <com.joanzapata.iconify.widget.IconButton
                android:id="@+id/back_iconbutton"
                style="@style/ToolbarButton"
                android:layout_alignParentRight="true"
                android:text="@string/icon_material_arrow_forward"
                android:textSize="24sp" />

            <TextView
                android:id="@+id/toolbar_title_textview"
                fontPath="@string/bold_font_path"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_toLeftOf="@id/back_iconbutton"
                android:textAppearance="?android:textAppearanceMedium"
                android:textColor="@color/colorTextLight" />

        </RelativeLayout>

    </android.support.v7.widget.Toolbar>

    <com.github.rahatarmanahmed.cpv.CircularProgressView
        android:id="@+id/order_loading_progress_circularprogressview"
        android:layout_width="@dimen/circular_progress_width"
        android:layout_height="@dimen/circular_progress_width"
        android:layout_centerInParent="true"
        app:cpv_animAutostart="true"
        app:cpv_color="@color/colorPrimaryDark"
        app:cpv_indeterminate="true" />

    <ScrollView
        android:id="@+id/order_activity_content_scrollview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/toolbar"
        android:fillViewport="true">

        <android.support.constraint.ConstraintLayout
            android:id="@+id/order_activity_content_constraintlayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <RelativeLayout
                android:id="@+id/status_send_relative"
                android:layout_width="0dp"
                android:layout_height="50dp"
                android:layout_marginEnd="16dp"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:layout_marginStart="16dp"
                app:layout_constraintBottom_toTopOf="@+id/ordered_products_list_recyclerview"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="parent">

                <Switch
                    android:id="@+id/status_send_switch"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="10dp"
                    android:gravity="center_vertical" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="5dp"
                    android:layout_toRightOf="@+id/status_send_switch"
                    android:gravity="center_vertical"
                    android:text="@string/not_send" />
            </RelativeLayout>

            <android.support.v7.widget.RecyclerView
                android:id="@+id/ordered_products_list_recyclerview"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginEnd="16dp"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:layout_marginStart="16dp"
                android:layout_marginTop="8dp"
                app:layout_constraintBottom_toTopOf="@+id/personal_profile_cardview"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/status_send_relative" />

            <android.support.v7.widget.CardView
                android:id="@+id/personal_profile_cardview"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:layout_marginTop="8dp"
                app:layout_constraintBottom_toTopOf="@+id/sum_bills_cardview"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/ordered_products_list_recyclerview">

                <android.support.constraint.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_marginBottom="16dp"
                    android:layout_marginTop="16dp">

                    <com.joanzapata.iconify.widget.IconButton
                        android:id="@+id/person_iconbutton"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:background="@null"
                        android:text="@string/md_person"
                        app:layout_constraintHorizontal_weight="1"
                        app:layout_constraintLeft_toRightOf="@+id/name_textview"
                        app:layout_constraintRight_toRightOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <TextView
                        android:id="@+id/name_textview"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:gravity="right"
                        android:text="حسن الماسی"
                        app:layout_constraintBaseline_toBaselineOf="@+id/person_iconbutton"
                        app:layout_constraintHorizontal_weight="5"
                        app:layout_constraintLeft_toLeftOf="parent"
                        app:layout_constraintRight_toLeftOf="@+id/person_iconbutton"
                        app:layout_constraintTop_toTopOf="parent" />


                    <com.joanzapata.iconify.widget.IconButton
                        android:id="@+id/date_iconbutton"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:background="@null"
                        android:text="@string/icon_fa_date"
                        app:layout_constraintHorizontal_weight="1"
                        app:layout_constraintLeft_toRightOf="@+id/date_textview"
                        app:layout_constraintRight_toRightOf="parent"
                        app:layout_constraintTop_toBottomOf="@+id/person_iconbutton" />

                    <TextView
                        android:id="@+id/date_textview"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:gravity="right"
                        android:text="1254862268522655"
                        app:layout_constraintBaseline_toBaselineOf="@+id/date_iconbutton"
                        app:layout_constraintHorizontal_weight="5"
                        app:layout_constraintLeft_toLeftOf="parent"
                        app:layout_constraintRight_toLeftOf="@+id/date_iconbutton"
                        app:layout_constraintRight_toRightOf="@+id/name_textview"
                        app:layout_constraintTop_toBottomOf="@+id/name_textview" />

                    <com.joanzapata.iconify.widget.IconButton
                        android:id="@+id/location_iconbutton"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:background="@null"
                        android:text="@string/icon_material_location_on"
                        app:layout_constraintHorizontal_weight="1"
                        app:layout_constraintLeft_toRightOf="@+id/location_textview"
                        app:layout_constraintRight_toRightOf="parent"
                        app:layout_constraintTop_toBottomOf="@+id/date_iconbutton" />

                    <TextView
                        android:id="@+id/location_textview"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:gravity="right"
                        android:text="111 پردیسان پردیسان پردیسان پردیسان پردیسان پردیسان پردیسان پردیسان پردیسان پردیسانپردیسان پردیسان پردیسان پردیسان پردیسان پردیسان پردیسان 222"
                        app:layout_constraintBaseline_toBaselineOf="@+id/location_iconbutton"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintHorizontal_weight="5"
                        app:layout_constraintLeft_toLeftOf="parent"
                        app:layout_constraintRight_toRightOf="@+id/date_textview"
                        app:layout_constraintTop_toBottomOf="@+id/date_textview" />

                </android.support.constraint.ConstraintLayout>

            </android.support.v7.widget.CardView>

            <android.support.v7.widget.CardView
                android:id="@+id/sum_bills_cardview"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:layout_marginTop="8dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/personal_profile_cardview">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginBottom="16dp"
                    android:layout_marginLeft="16dp"
                    android:layout_marginRight="16dp"
                    android:layout_marginTop="16dp"
                    android:weightSum="2">

                    <TextView
                        android:id="@+id/title_sum_bills_textview"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="50000000" />

                    <TextView
                        android:id="@+id/value_sum_bills_textview"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:text="@string/sum_bills" />

                </LinearLayout>
            </android.support.v7.widget.CardView>
        </android.support.constraint.ConstraintLayout>

    </ScrollView>
</RelativeLayout>

  • RelativeLayout
    下的
    ConstraintLayout
    具有
    android:layout\u marginEnd=“16dp”
  • RecyclerView
    关闭
    RelativeLayout
    后,has
    android:layout\u marginEnd=“16dp”
  • ConstraintLayout
    inside
    cardwiew
    has
    android:layout\u marginBottom=“16dp”
  • LinearLayout
    inside last
    cardwiew
    has
    android:layout\u marginBottom=“16dp”

  • 尝试更改或删除它们&看看是否有效。在我看来,删除这4个参数应该是可行的。

    您在ConstraintLayout下面的RelativeLayout中使用了边距

    android:layout_marginEnd="16dp"
    android:layout_marginLeft="16dp"
    android:layout_marginRight="16dp"
    android:layout_marginStart="16dp"
    
    尝试从中删除上面的行

     <RelativeLayout
                android:id="@+id/status_send_relative"
                android:layout_width="0dp"
                android:layout_height="50dp"
                android:layout_marginEnd="16dp"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:layout_marginStart="16dp"
                app:layout_constraintBottom_toTopOf="@+id/ordered_products_list_recyclerview"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="parent">
    
    
    
    请提供该空间的屏幕截图!提供这些
    部分布局的id和屏幕截图。我有大空间的波纹管布局。