Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/202.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_Android Recyclerview_Android Appbarlayout - Fatal编程技术网

Android 滚动活动中的Recyclerview存在空白问题

Android 滚动活动中的Recyclerview存在空白问题,android,android-recyclerview,android-appbarlayout,Android,Android Recyclerview,Android Appbarlayout,我的Recyclerview内部滚动活动中有一个空白问题。 请帮我解决这个问题。我已经检查了我所知道的一切,比如没有边距、填充物、尝试移除晶圆厂。但问题依然存在 我的XML代码: 试试这个: <android.support.design.widget.AppBarLayout android:id="@+id/app_bar" android:layout_width="match_parent" android:layout_heig

我的Recyclerview内部滚动活动中有一个空白问题。 请帮我解决这个问题。我已经检查了我所知道的一切,比如没有边距、填充物、尝试移除晶圆厂。但问题依然存在

我的XML代码:


试试这个:

<android.support.design.widget.AppBarLayout
        android:id="@+id/app_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        android:theme="@style/AppTheme.AppBarOverlay">

至少我现在明白了, 首先,感谢在他的同一期文章中给了我一个想法

我从
协调器布局中删除了
android:fitsystemwindows=“true”

现在,通知栏的颜色可能会变为透明,看起来很恐怖。因此,我在样式中添加了
@color/colorPrimary


现在一切都好了。

尝试删除
android:fitsystemwindows=“true”
android:layout\u height=“wrap\u content”



发布您的完整xml代码,我可以看到一些部分丢失。看起来您与AppBarLayout之间的高度大于内容和空白。将其替换为包裹内容。请确保布局具有正确的高度。在我看来,它似乎错过了状态栏的大小。检查如果从Coordinator布局中删除“fitsSystemWindows”会发生什么情况。把它放在AppBar里吧。你提到的代码似乎没问题。需要检查RecyclerView的列表项布局。此问题发生在appbar和recycler之间,似乎与它们的wxh无关。谢谢,但是如果您现在注意到,通知栏的颜色可能不是应用程序主题颜色的一部分,因为它不再是“下方”,而是“下方”。@TWL:是的,我也改变了这一点,在样式中添加了
@color/colorPrimary
,如果我放入
android:layout\u height=“wrap\u content”
应用程序栏将消失。您是否尝试过删除
android:fitsystemwindows=“true”
,然后放入
android:layout\u height=“wrap\u content”
<android.support.design.widget.AppBarLayout
        android:id="@+id/app_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        android:theme="@style/AppTheme.AppBarOverlay">
<android.support.design.widget.AppBarLayout
        android:id="@+id/app_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">