当前位置:网站首页>横向滚动的RecycleView一屏显示五个半,低于五个平均分布
横向滚动的RecycleView一屏显示五个半,低于五个平均分布
2022-07-05 09:41: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);
}边栏推荐
- 字节跳动面试官:一张图片占据的内存大小是如何计算
- The Alipay in place function can't be found, and the Alipay in place function is offline
- MySQL字符类型学习笔记
- tongweb设置gzip
- MySQL digital type learning notes
- Tdengine offline upgrade process
- Click the picture in the mobile browser and the picture will not pop up
- Roll up, break through 35 year old anxiety, and animate the CPU to record the function call process
- Kotlin Compose 与原生 嵌套使用
- 把欧拉的创新带向世界 SUSE 要做那个引路人
猜你喜欢

How to use sqlcipher tool to decrypt encrypted database under Windows system

Apache dolphin scheduler system architecture design

苹果 5G 芯片研发失败?想要摆脱高通为时过早
![[NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution](/img/f3/782246100bca3517d95869be80d9c5.png)
[NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution

Wechat applet - simple diet recommendation (2)

如何獲取GC(垃圾回收器)的STW(暫停)時間?

基于单片机步进电机控制器设计(正转反转指示灯挡位)

《微信小程序-基础篇》小程序中的事件与冒泡

Swift tableview style (I) system basic

Understand the window query function of tdengine in one article
随机推荐
能源势动:电力行业的碳中和该如何实现?
Small program startup performance optimization practice
The Alipay in place function can't be found, and the Alipay in place function is offline
驱动制造业产业升级新思路的领域知识网络,什么来头?
Cerebral Cortex:有向脑连接识别帕金森病中广泛存在的功能网络异常
《剑来》语句摘录(七)
Charm of code language
程序员搞开源,读什么书最合适?
Unity particle special effects series - the poison spray preform is ready, and the unitypackage package is directly used - on
历史上的今天:第一本电子书问世;磁条卡的发明者出生;掌上电脑先驱诞生...
Apache dolphin scheduler system architecture design
Mysql80 service does not start
Solve liquibase – waiting for changelog lock Cause database deadlock
Swift tableview style (I) system basic
. Net delay queue
Application of data modeling based on wide table
Tdengine connector goes online Google Data Studio app store
Tianlong Babu TLBB series - about items dropped from packages
The writing speed is increased by dozens of times, and the application of tdengine in tostar intelligent factory solution
面试:List 如何根据对象的属性去重?