当前位置:网站首页>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);
}
边栏推荐
- LiveData 面试题库、解答---LiveData 面试 7 连问~
- .Net之延迟队列
- 橫向滾動的RecycleView一屏顯示五個半,低於五個平均分布
- [200 opencv routines] 219 Add digital watermark (blind watermark)
- 如何获取GC(垃圾回收器)的STW(暂停)时间?
- QT VT100 parser
- How to get the STW (pause) time of GC (garbage collector)?
- isEmpty 和 isBlank 的用法区别
- Cut off 20% of Imagenet data volume, and the performance of the model will not decline! Meta Stanford et al. Proposed a new method, using knowledge distillation to slim down the data set
- Getting started with Apache dolphin scheduler (one article is enough)
猜你喜欢
Mobile heterogeneous computing technology GPU OpenCL programming (Advanced)
QT timer realizes dynamic display of pictures
单片机原理与接口技术(ESP8266/ESP32)机器人类草稿
一种用于干式脑电图的高密度256通道电极帽
Evolution of Baidu intelligent applet patrol scheduling scheme
学习笔记5--高精地图解决方案
Unity粒子特效系列-毒液喷射预制体做好了,unitypackage包直接用 -下
Observation cloud and tdengine have reached in-depth cooperation to optimize the cloud experience of enterprises
钉钉、企微、飞书学会赚钱了吗?
把欧拉的创新带向世界 SUSE 要做那个引路人
随机推荐
QT realizes signal transmission and reception between two windows
The king of pirated Dall · e? 50000 images per day, crowded hugging face server, and openai ordered to change its name
Wechat applet - simple diet recommendation (4)
Application of data modeling based on wide table
Uni app running to wechat development tool cannot Preview
Data visualization platform based on template configuration
Apache DolphinScheduler 入门(一篇就够了)
横向滚动的RecycleView一屏显示五个半,低于五个平均分布
Glide advanced level
A high density 256 channel electrode cap for dry EEG
ArcGIS Pro creating features
Swift set pickerview to white on black background
QT timer realizes dynamic display of pictures
Those who are good at using soldiers, hide in the invisible, and explain the best promotional value works in depth in 90 minutes
程序员搞开源,读什么书最合适?
剪掉ImageNet 20%数据量,模型性能不下降!Meta斯坦福等提出新方法,用知识蒸馏给数据集瘦身...
Theme. AppCompat. Light. Darkactionbar not found
Analysis on the wallet system architecture of Baidu trading platform
Lepton 无损压缩原理及性能分析
Comparison of batch merge between Oracle and MySQL