当前位置:网站首页>橫向滾動的RecycleView一屏顯示五個半,低於五個平均分布
橫向滾動的RecycleView一屏顯示五個半,低於五個平均分布
2022-07-05 10:11: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);
}
边栏推荐
- Small program startup performance optimization practice
- Wechat applet - simple diet recommendation (2)
- [tips] get the x-axis and y-axis values of cdfplot function in MATLAB
- RMS TO EAP通过MQTT简单实现
- Cent7 Oracle database installation error
- (1) Complete the new construction of station in Niagara vykon N4 supervisor 4.8 software
- The Alipay in place function can't be found, and the Alipay in place function is offline
- 自动化规范检查软件如何发展而来?
- 卷起来,突破35岁焦虑,动画演示CPU记录函数调用过程
- ThreadLocal source code learning
猜你喜欢
Wechat applet - simple diet recommendation (4)
The writing speed is increased by dozens of times, and the application of tdengine in tostar intelligent factory solution
Tdengine can read and write through dataX, a data synchronization tool
cent7安装Oracle数据库报错
Design and Simulation of fuzzy PID control system for liquid level of double tank (matlab/simulink)
Uni app running to wechat development tool cannot Preview
Baidu app's continuous integration practice based on pipeline as code
Idea debugs com intellij. rt.debugger. agent. Captureagent, which makes debugging impossible
如何判断线程池已经执行完所有任务了?
让AI替企业做复杂决策真的靠谱吗?参与直播,斯坦福博士来分享他的选择|量子位·视点...
随机推荐
卷起来,突破35岁焦虑,动画演示CPU记录函数调用过程
高级 OpenCV:BGR 像素强度图
Comparison of batch merge between Oracle and MySQL
【小技巧】獲取matlab中cdfplot函數的x軸,y軸的數值
【系统设计】指标监控和告警系统
天龙八部TLBB系列 - 单体技能群伤
H. 265 introduction to coding principles
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
Those who are good at using soldiers, hide in the invisible, and explain the best promotional value works in depth in 90 minutes
Node-RED系列(二九):使用slider与chart节点来实现双折线时间序列图
MySQL character type learning notes
View Slide
TDengine × Intel edge insight software package accelerates the digital transformation of traditional industries
Cent7 Oracle database installation error
Matrix processing practice
[app packaging error] to proceed, either fix the issues identified by lint, or modify your build script as follow
《微信小程序-基础篇》小程序中的事件与冒泡
Flutter development: use safearea
Using directive in angualr2 to realize that the picture size changes with the window size
cent7安装Oracle数据库报错