当前位置:网站首页>The horizontally scrolling recycleview displays five and a half on one screen, lower than the average distribution of five
The horizontally scrolling recycleview displays five and a half on one screen, lower than the average distribution of five
2022-07-05 10:11:00 【A bird carved in the desert】
@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);
}
边栏推荐
- 如何写出高质量的代码?
- Advanced opencv:bgr pixel intensity map
- 程序员如何活成自己喜欢的模样?
- Theme. AppCompat. Light. Darkactionbar not found
- MySQL字符类型学习笔记
- leetcode:1200. 最小绝对差
- LiveData 面试题库、解答---LiveData 面试 7 连问~
- The essence of persuasion is to remove obstacles
- Click the picture in the mobile browser and the picture will not pop up
- (1) Complete the new construction of station in Niagara vykon N4 supervisor 4.8 software
猜你喜欢
Energy momentum: how to achieve carbon neutralization in the power industry?
盗版DALL·E成梗图之王?日产5万张图像,挤爆抱抱脸服务器,OpenAI勒令改名
Baidu app's continuous integration practice based on pipeline as code
The comparison of every() and some() in JS uses a power storage plan
卷起來,突破35歲焦慮,動畫演示CPU記錄函數調用過程
自动化规范检查软件如何发展而来?
[C language] the use of dynamic memory development "malloc"
Getting started with Apache dolphin scheduler (one article is enough)
Tdengine already supports the industrial Intel edge insight package
美图炒币半年亏了3个亿,华为被曝在俄罗斯扩招,AlphaGo的同类又刷爆一种棋,今日更多大新闻在此...
随机推荐
@SerializedName注解使用
[NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution
Cerebral Cortex:有向脑连接识别帕金森病中广泛存在的功能网络异常
面试:Bitmap像素内存分配在堆内存还是在native中
Observation cloud and tdengine have reached in-depth cooperation to optimize the cloud experience of enterprises
Wechat applet - simple diet recommendation (3)
学习笔记5--高精地图解决方案
Roll up, break through 35 year old anxiety, and animate the CPU to record the function call process
Glide advanced level
Those who are good at using soldiers, hide in the invisible, and explain the best promotional value works in depth in 90 minutes
Pagoda panel MySQL cannot be started
如何判断线程池已经执行完所有任务了?
双容水箱液位模糊PID控制系统设计与仿真(Matlab/Simulink)
cent7安装Oracle数据库报错
Node red series (29): use slider and chart nodes to realize double broken line time series diagram
MySQL digital type learning notes
《微信小程序-基础篇》小程序中的事件与冒泡
H. 265 introduction to coding principles
Mobile heterogeneous computing technology GPU OpenCL programming (Advanced)
橫向滾動的RecycleView一屏顯示五個半,低於五個平均分布