当前位置:网站首页>橫向滾動的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);
}边栏推荐
- 面试:List 如何根据对象的属性去重?
- 一种用于干式脑电图的高密度256通道电极帽
- Mobile heterogeneous computing technology GPU OpenCL programming (Advanced)
- mysql80服务不启动
- Observation cloud and tdengine have reached in-depth cooperation to optimize the cloud experience of enterprises
- How to correctly evaluate video image quality
- Fluent generates icon prompt logo widget
- 宝塔面板MySQL无法启动
- Hard core, have you ever seen robots play "escape from the secret room"? (code attached)
- MySQL digital type learning notes
猜你喜欢

How Windows bat script automatically executes sqlcipher command

Is it really reliable for AI to make complex decisions for enterprises? Participate in the live broadcast, Dr. Stanford to share his choice | qubit · viewpoint

The king of pirated Dall · e? 50000 images per day, crowded hugging face server, and openai ordered to change its name

驱动制造业产业升级新思路的领域知识网络,什么来头?

Unity particle special effects series - the poison spray preform is ready, and the unitypackage package is directly used - on

QT realizes signal transmission and reception between two windows

Roll up, break through 35 year old anxiety, and animate the CPU to record the function call process

Roll up, break 35 - year - old Anxiety, animation Demonstration CPU recording Function call Process

能源势动:电力行业的碳中和该如何实现?

Design and exploration of Baidu comment Center
随机推荐
Unity particle special effects series - the poison spray preform is ready, and the unitypackage package is directly used - on
Analysis on the wallet system architecture of Baidu trading platform
Design and exploration of Baidu comment Center
Flutter development: use safearea
CSDN always jumps to other positions when editing articles_ CSDN sends articles without moving the mouse
美图炒币半年亏了3个亿,华为被曝在俄罗斯扩招,AlphaGo的同类又刷爆一种棋,今日更多大新闻在此...
QT timer realizes dynamic display of pictures
90%的人都不懂的泛型,泛型的缺陷和应用场景
The king of pirated Dall · e? 50000 images per day, crowded hugging face server, and openai ordered to change its name
[tips] get the x-axis and y-axis values of cdfplot function in MATLAB
TypeError: Cannot read properties of undefined (reading ‘cancelToken‘)
Using directive in angualr2 to realize that the picture size changes with the window size
LiveData 面试题库、解答---LiveData 面试 7 连问~
RMS to EAP is simply implemented through mqtt
oracle和mysql批量Merge对比
程序员如何活成自己喜欢的模样?
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
天龙八部TLBB系列 - 关于包裹掉落的物品
Tianlong Babu TLBB series - about items dropped from packages
【系统设计】指标监控和告警系统