Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/215.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.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
Android Recyclerview列表未到达列表的底部_Android_Xml_Layout_Android Recyclerview_Fade - Fatal编程技术网

Android Recyclerview列表未到达列表的底部

Android Recyclerview列表未到达列表的底部,android,xml,layout,android-recyclerview,fade,Android,Xml,Layout,Android Recyclerview,Fade,我正在尝试在某些内容下显示recyclerview列表。我的问题是我的recyclerview列表没有到达它的末尾。示例中的最后一个图标只显示了一半。此外,如果可能的话,我想知道我如何才能淡出我的列表顶部,这样它看起来就不会被切断 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

我正在尝试在某些内容下显示recyclerview列表。我的问题是我的recyclerview列表没有到达它的末尾。示例中的最后一个图标只显示了一半。此外,如果可能的话,我想知道我如何才能淡出我的列表顶部,这样它看起来就不会被切断

<?xml version="1.0" encoding="utf-8"?>

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:weightSum="1"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:background="?attr/selectableItemBackground"
        tools:context="match_parent"
        xmlns:tools="http://schemas.android.com/tools">

        <com.github.siyamed.shapeimageview.CircularImageView
            android:layout_width="87dp"
            android:layout_height="63dp"
            android:src="@drawable/snappy"
            app:siBorderWidth="2dp"
            app:siBorderColor="@color/colorPrimary"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp"
            android:layout_marginLeft="10dp"
            android:layout_weight="0.02" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="Name"
            android:id="@+id/textView3"
            android:textColor="#116c99"
            android:typeface="sans"
            android:layout_marginTop="-95dp"
            android:layout_marginLeft="110dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:text="Daten"
            android:id="@+id/textView5"
            android:layout_marginTop="0dp"
            android:layout_marginLeft="110dp" />

        <TextView
            android:layout_width="263dp"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:id="@+id/textView6"
            android:textSize="10dp"
            android:layout_marginLeft="110dp"
            android:layout_marginTop="5dp"
            android:text="@string/statusId" />


        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="#d8d8d8"
            android:layout_marginTop="15dp"
            android:layout_marginRight="15dp"
            android:layout_marginLeft="15dp" />

        <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text="Kontaktschriftzug"
        android:id="@+id/textView4"
        android:layout_marginTop="5dp"
            android:textSize="12dp"
        android:textColor="#0071a6"
        android:typeface="sans"
        android:textStyle="bold"
            android:layout_marginLeft="15dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:text="Kategorie"
            android:id="@+id/textView77"
            android:layout_marginTop="10dp"
            android:textSize="10dp"
            android:textColor="#848484"
            android:typeface="sans"
            android:layout_marginLeft="15dp" />

    <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"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:context="com.appmak.ron.recycleviewer.MainActivity"
        tools:showIn="@layout/activity_main">

        <android.support.v7.widget.RecyclerView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:id="@+id/recycleviewMeineKarte">
        </android.support.v7.widget.RecyclerView>

    </RelativeLayout>

</LinearLayout>

删除此行android:weightSum=“1”此处:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:weightSum="1"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="?attr/selectableItemBackground"
    tools:context="match_parent"
    xmlns:tools="http://schemas.android.com/tools">
<com.github.siyamed.shapeimageview.CircularImageView
        android:layout_width="87dp"
        android:layout_height="63dp"
        android:src="@drawable/snappy"
        app:siBorderWidth="2dp"
        app:siBorderColor="@color/colorPrimary"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="10dp"
        android:layout_marginLeft="10dp"
        android:layout_weight="0.02" />


删除这一行,如下所示:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:weightSum="1"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="?attr/selectableItemBackground"
    tools:context="match_parent"
    xmlns:tools="http://schemas.android.com/tools">
<com.github.siyamed.shapeimageview.CircularImageView
        android:layout_width="87dp"
        android:layout_height="63dp"
        android:src="@drawable/snappy"
        app:siBorderWidth="2dp"
        app:siBorderColor="@color/colorPrimary"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="10dp"
        android:layout_marginLeft="10dp"
        android:layout_weight="0.02" />


您需要为所有视图使用权重属性才能按预期工作

您可能希望将父项从
LinearLayout
更改为
RelativeLayout
,并将项目相对定位,而不是使用负边距使用布局权重对每个组件进行布局,并确保自定义视图组件未设置动态高度宽度。您的布局与您描述的方式正确谢谢,它起到了作用!我是android编程新手。它的重量属性有什么好处?除了褪色之外,一切都像我希望的那样工作。非常感谢你。