当前位置:网站首页>横向滚动的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);
}边栏推荐
- 高级 OpenCV:BGR 像素强度图
- Coordinate system of view
- Tianlong Babu TLBB series - single skill group injury
- Wechat applet - simple diet recommendation (2)
- 能源势动:电力行业的碳中和该如何实现?
- Tianlong Babu TLBB series - about items dropped from packages
- Solve the problem of no all pattern found during Navicat activation and registration
- Unity粒子特效系列-毒液喷射预制体做好了,unitypackage包直接用 -下
- 《微信小程序-基础篇》小程序中的事件与冒泡
- Apache DolphinScheduler 入门(一篇就够了)
猜你喜欢

ArcGIS Pro 创建要素

Cent7 Oracle database installation error

让AI替企业做复杂决策真的靠谱吗?参与直播,斯坦福博士来分享他的选择|量子位·视点...

Apache DolphinScheduler 入门(一篇就够了)

Unity particle special effects series - the poison spray preform is ready, and the unitypackage package is directly used - on

To bring Euler's innovation to the world, SUSE should be the guide

钉钉、企微、飞书学会赚钱了吗?

oracle 多行数据合并成一行数据

Node-RED系列(二九):使用slider与chart节点来实现双折线时间序列图

分布式数据库下子查询和 Join 等复杂 SQL 如何实现?
随机推荐
. Net delay queue
Getting started with Apache dolphin scheduler (one article is enough)
解决idea调试过程中liquibase – Waiting for changelog lock….导致数据库死锁问题
How to correctly evaluate video image quality
驱动制造业产业升级新思路的领域知识网络,什么来头?
善用兵者,藏于无形,90 分钟深度讲解最佳推广价值作品
让AI替企业做复杂决策真的靠谱吗?参与直播,斯坦福博士来分享他的选择|量子位·视点...
Apache dolphin scheduler system architecture design
Tdengine connector goes online Google Data Studio app store
Mysql80 service does not start
ThreadLocal source code learning
Matrix processing practice
Common fault analysis and Countermeasures of using MySQL in go language
Pagoda panel MySQL cannot be started
tongweb设置gzip
Are databases more popular as they get older?
Small program startup performance optimization practice
ArcGIS Pro creating features
Swift tableview style (I) system basic
A high density 256 channel electrode cap for dry EEG