当前位置:网站首页>横向滚动的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);
}
边栏推荐
- Comment obtenir le temps STW du GC (collecteur d'ordures)?
- QT event filter simple case
- Wechat applet - simple diet recommendation (2)
- 一种用于干式脑电图的高密度256通道电极帽
- Coordinate system of view
- 程序员搞开源,读什么书最合适?
- How Windows bat script automatically executes sqlcipher command
- [tips] get the x-axis and y-axis values of cdfplot function in MATLAB
- Application of data modeling based on wide table
- Node red series (29): use slider and chart nodes to realize double broken line time series diagram
猜你喜欢
tongweb设置gzip
Charm of code language
. Net delay queue
单片机原理与接口技术(ESP8266/ESP32)机器人类草稿
Apache DolphinScheduler 系统架构设计
Common fault analysis and Countermeasures of using MySQL in go language
Tdengine can read and write through dataX, a data synchronization tool
MySQL character type learning notes
自动化规范检查软件如何发展而来?
Small program startup performance optimization practice
随机推荐
Windows uses commands to run kotlin
(1) Complete the new construction of station in Niagara vykon N4 supervisor 4.8 software
Solve the problem of no all pattern found during Navicat activation and registration
字节跳动面试官:一张图片占据的内存大小是如何计算
Roll up, break 35 - year - old Anxiety, animation Demonstration CPU recording Function call Process
Coffeescript Chinese character to pinyin code
最全是一次I2C总结
【C语言】动态内存开辟的使用『malloc』
Design and exploration of Baidu comment Center
How to get the STW (pause) time of GC (garbage collector)?
[app packaging error] to proceed, either fix the issues identified by lint, or modify your build script as follow
Comment obtenir le temps STW du GC (collecteur d'ordures)?
Design of stepping motor controller based on single chip microcomputer (forward rotation and reverse rotation indicator gear)
QT event filter simple case
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
Hard core, have you ever seen robots play "escape from the secret room"? (code attached)
Jupiter notebook shortcut key
Z-blog template installation and use tutorial
【小技巧】獲取matlab中cdfplot函數的x軸,y軸的數值
[system design] index monitoring and alarm system