当前位置:网站首页>横向滚动的RecycleView一屏显示五个半,低于五个平均分布
横向滚动的RecycleView一屏显示五个半,低于五个平均分布
2022-06-28 00:57:00 【沙漠一只雕得儿得儿】
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View itemView = mInflater.inflate(R.layout.layout_item_hq_cn_icon, parent, false);
int columnWidth;
if (mDataSet.size() > 5) {
columnWidth = (int) (parent.getMeasuredWidth() / 5.57f);
} else {
columnWidth = (int) (parent.getMeasuredWidth() / mDataSet.size());
}
RecyclerView.LayoutParams lp = new RecyclerView.LayoutParams(columnWidth, RecyclerView.LayoutParams.WRAP_CONTENT);
itemView.setLayoutParams(lp);
return ViewHolder.createViewHolder(mContext, itemView);
}边栏推荐
- Dynamic Host Configuration Protocol
- 【二維碼圖像矯正增强】基於MATLAB的二維碼圖像矯正增强處理仿真
- 【历史上的今天】6 月 1 日:Napster 成立;MS-DOS 原作者出生;谷歌出售 Google SketchUp
- 【电梯控制系统】基于VHDL语言和状态机实现的电梯控制系统的设计,使用了状态机
- Leetcode topic [array] -228- summary interval
- JS实现滑动拼图验证
- 4G-learn from great partners
- Stm32f1 and stm32subeide programming example - metal touch sensor driver
- Flask基础:模板渲染+模板过滤使用+控制语句
- 【历史上的今天】6 月 11 日:蒙特卡罗方法的共同发明者出生;谷歌推出 Google 地球;谷歌收购 Waze
猜你喜欢

Exploration on the construction path of real-time digital warehouse integrating digital intelligence learning and streaming batch

Opencv——几何空间变换(仿射变换和投影变换)

How to systematically learn LabVIEW?

Win11不能拖拽圖片到任務欄軟件上快速打開怎麼辦

Complex and inefficient logistics? Three steps to solve problems in enterprise administration
![[today in history] May 29: the pioneer of sharing software was born; Chromebox launched; VoodooPC founder was born](/img/ba/aa5db22e1391886a4e263d10e5f9f7.png)
[today in history] May 29: the pioneer of sharing software was born; Chromebox launched; VoodooPC founder was born

把腾讯搬上云:云服务器 CVM 的半部进化史

在线JSON转PlainText工具

MySQL optimization tips

Character interception triplets of data warehouse: substrb, substr, substring
随机推荐
【历史上的今天】6 月 3 日:微软推出必应搜索引擎;Larry Roberts 启动阿帕网;Visual Basic 之父出生
原理图合并中的技巧
架构高可靠性应用知识图谱 ----- 架构演进之路
[block coding] simulation of image block coding based on MATLAB
Opencv -- Hough transform and some problems encountered
How technicians become experts in technical field
设计电商秒杀系统
Protocole de transfert de fichiers - - FTP
如何系统学习LabVIEW?
File transfer protocol --ftp
英特尔锐炫A380显卡即将在中国面市
Keil “st-link usb communication error“解决方法
MySQL optimization tips
LeetCode - Easy - 197
Cloud platform KVM migration local virtual machine records
启牛开户安全吗?怎么线上开户?
Teach you how to realize pynq-z2 bar code recognition
一种低成本增长私域流量,且维护简单的方法
JS implementation of Slide Puzzle verification
math_(函数&数列)极限的含义&误区和符号梳理/邻域&去心邻域&邻域半径