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
Android-RecyclerView GridLayout上的图像位于底部_Android_Android Recyclerview - Fatal编程技术网

Android-RecyclerView GridLayout上的图像位于底部

Android-RecyclerView GridLayout上的图像位于底部,android,android-recyclerview,Android,Android Recyclerview,这是我当前的Gridlayout代码: image_list.setLayoutManager(new GridLayoutManager(this, 3, LinearLayoutManager.VERTICAL, true)); 当我这样做时,所有这些图像都排在底部,而不是顶部。反正我能修好这个?谢谢。将reverselayout设置为false //Like this image_list.setLayoutManager(new GridLayoutManager(this, 3,

这是我当前的
Gridlayout
代码:

image_list.setLayoutManager(new GridLayoutManager(this, 3, LinearLayoutManager.VERTICAL, true));

当我这样做时,所有这些图像都排在底部,而不是顶部。反正我能修好这个?谢谢。

将reverselayout设置为false

 //Like this
 image_list.setLayoutManager(new GridLayoutManager(this, 3, LinearLayoutManager.VERTICAL, false));
文件:


你必须将reverseLayout Boolean设置为false。我不明白你的意思。你能简单解释一下吗?把你的图像提取代码作为参考。我是通过FireBaseRecyclerAdapter进行的。如果我将其设置为false,gridlayout的最旧图片在顶部,而新图片在底部。无论如何,要解决这个问题?需要对数组列表进行排序才能实现。我正在从Firebase中提取图像,这是如何实现的?
 /**
 * @param context Current context, will be used to access resources.
 * @param spanCount The number of columns or rows in the grid
 * @param orientation Layout orientation. Should be {@link #HORIZONTAL} or {@link
 *                      #VERTICAL}.
 * @param reverseLayout When set to true, layouts from end to start.
 */
public GridLayoutManager(Context context, int spanCount, int orientation,
        boolean reverseLayout) {
    super(context, orientation, reverseLayout);
    setSpanCount(spanCount);
}