android - 在 RecyclerView 中设置逻辑填充数据
问题描述
我有 Recycler View 来显示我的网格。我的数据是int[] list = {1, 2, 3, 4, 5, 6, 7};
并且我使用代码
mRv.setLayoutManager(new GridLayoutManager(mRvIcon.getContext(), 5, GridLayoutManager.VERTICAL, false));
mRv.setAdapter(myAdapter);
我有结果:
但我想填充数据相同
我该怎么做?
解决方案
尝试像这样添加布局管理器
new GridLayoutManager(this, 5, GridLayoutManager.HORIZONTAL, false)
推荐阅读
- python - 将参数和变量从装饰器传递给 Python 中的函数
- python - 为什么我的 for 循环运行次数超过我指定的次数?
- php - 无法让 Zend 在 Windows 7 上使用 PHP
- c++ - C ++将两个不同类型的向量的属性连接到新向量中
- javascript - 无法使用 jquery 重定向到页面
- python-3.x - Python:在另一个数组的位置设置数组的值
- sql - Take() 使用实体框架获取表中的所有行(查询视图时)
- c++ - 围绕“?”的使用感到困惑,因为没有假定值
- amazon-web-services - AWS S3 上传的文件未显示
- javascript - Extjs - 在 Model.save() 中重试 API 请求