当前位置:网站首页>横向滚动的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);
}边栏推荐
- [system design] index monitoring and alarm system
- TDengine × Intel edge insight software package accelerates the digital transformation of traditional industries
- Six simple cases of QT
- A high density 256 channel electrode cap for dry EEG
- 历史上的今天:第一本电子书问世;磁条卡的发明者出生;掌上电脑先驱诞生...
- Hard core, have you ever seen robots play "escape from the secret room"? (code attached)
- Tongweb set gzip
- ThreadLocal source code learning
- 硬核,你见过机器人玩“密室逃脱”吗?(附代码)
- [NTIRE 2022]Residual Local Feature Network for Efficient Super-Resolution
猜你喜欢

The writing speed is increased by dozens of times, and the application of tdengine in tostar intelligent factory solution

【C语言】动态内存开辟的使用『malloc』
![[technical live broadcast] how to rewrite tdengine code from 0 to 1 with vscode](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[technical live broadcast] how to rewrite tdengine code from 0 to 1 with vscode

最全是一次I2C总结

卷起來,突破35歲焦慮,動畫演示CPU記錄函數調用過程

Common fault analysis and Countermeasures of using MySQL in go language

Cross process communication Aidl

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

【小技巧】获取matlab中cdfplot函数的x轴,y轴的数值

@SerializedName注解使用
随机推荐
Windows uses commands to run kotlin
程序员搞开源,读什么书最合适?
如何写出高质量的代码?
MySQL digital type learning notes
MySQL字符类型学习笔记
Click the picture in the mobile browser and the picture will not pop up
Coffeescript Chinese character to pinyin code
RMS to EAP is simply implemented through mqtt
Meitu lost 300 million yuan in currency speculation for half a year. Huawei was exposed to expand its enrollment in Russia. Alphago's peers have made another breakthrough in chess. Today, more big new
MySQL数字类型学习笔记
Generics, generic defects and application scenarios that 90% of people don't understand
美图炒币半年亏了3个亿,华为被曝在俄罗斯扩招,AlphaGo的同类又刷爆一种棋,今日更多大新闻在此...
How Windows bat script automatically executes sqlcipher command
钉钉、企微、飞书学会赚钱了吗?
单片机原理与接口技术(ESP8266/ESP32)机器人类草稿
硬核,你见过机器人玩“密室逃脱”吗?(附代码)
Mysql80 service does not start
Node-RED系列(二九):使用slider与chart节点来实现双折线时间序列图
一种用于干式脑电图的高密度256通道电极帽
天龙八部TLBB系列 - 关于技能冷却和攻击范围数量的问题