当前位置:网站首页>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);
}边栏推荐
- Fluent development: setting method of left and right alignment of child controls in row
- 苹果 5G 芯片研发失败?想要摆脱高通为时过早
- C#函数返回多个值方法
- [NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution
- Apache DolphinScheduler 入门(一篇就够了)
- 学习笔记5--高精地图解决方案
- LiveData 面试题库、解答---LiveData 面试 7 连问~
- Cerebral cortex: directed brain connection recognition widespread functional network abnormalities in Parkinson's disease
- La vue latérale du cycle affiche cinq demi - écrans en dessous de cinq distributions moyennes
- Tianlong Babu TLBB series - questions about skill cooling and the number of attack ranges
猜你喜欢

Cent7 Oracle database installation error

Unity粒子特效系列-毒液喷射预制体做好了,unitypackage包直接用 -下

Pagoda panel MySQL cannot be started

一种用于干式脑电图的高密度256通道电极帽

RMS TO EAP通过MQTT简单实现

QT timer realizes dynamic display of pictures

Implementation of smart home project

Hard core, have you ever seen robots play "escape from the secret room"? (code attached)

Cross process communication Aidl

如何写出高质量的代码?
随机推荐
自动化规范检查软件如何发展而来?
Wechat applet - simple diet recommendation (3)
90%的人都不懂的泛型,泛型的缺陷和应用场景
Kotlin Compose 与原生 嵌套使用
Comment obtenir le temps STW du GC (collecteur d'ordures)?
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
Click the picture in the mobile browser and the picture will not pop up
Apache DolphinScheduler 入门(一篇就够了)
B站大量虚拟主播被集体强制退款:收入蒸发,还倒欠B站;乔布斯被追授美国总统自由勋章;Grafana 9 发布|极客头条...
高级 OpenCV:BGR 像素强度图
> Could not create task ‘:app:MyTest.main()‘. > SourceSet with name ‘main‘ not found.问题修复
Swift set pickerview to white on black background
MySQL digital type learning notes
Hard core, have you ever seen robots play "escape from the secret room"? (code attached)
横向滚动的RecycleView一屏显示五个半,低于五个平均分布
如何判断线程池已经执行完所有任务了?
程序员如何活成自己喜欢的模样?
[NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution
Unity particle special effects series - the poison spray preform is ready, and the unitypackage package is directly used - on
The comparison of every() and some() in JS uses a power storage plan