如何使Android RecyclerView响应以适应最初的屏幕? [英] How can I make the Android RecyclerView responsive to fit the screen initially?

查看:68
本文介绍了如何使Android RecyclerView响应以适应最初的屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时,如果屏幕很大或覆盖屏幕的项目较少,RecyclerView会在底部显示空白区域.有时,如果有更多项目,它会部分显示一些项目.我想要的是:

Sometimes RecyclerView shows empty spaces at bottom if the screen is large or it has fewer items to cover the screen. Also sometimes it shows some items partially if it has more items. What I want is:

RecyclerView将覆盖给定编号的全部可用空间 行.无论尺寸是多少,它都会一直填满屏幕 屏幕.

RecyclerView will cover the full available space with the given number of rows. It will always fill the screen, no matter what is the size of the screen.

我该怎么办?

推荐答案

将match_parent用于宽度和高度.

use match_parent for both width and height.

这篇关于如何使Android RecyclerView响应以适应最初的屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆