donkingliang / LabelsView

Android的标签列表控件。可以设置标签的选中效果。 可以设置标签的选中类型:不可选中、单选、限数量多选和不限数量多选等, 并支持设置必选项、单行显示、最大显示行数等功能。
Apache License 2.0
1.02k stars 157 forks source link

对于数据一多,个别情况下无法展示全数据的问题 #12

Closed diguagege closed 5 years ago

diguagege commented 6 years ago

在onMeasure的时候 if (maxWidth <= lineWidth + view.getMeasuredWidth()) { contentHeight += mLineMargin; contentHeight += maxItemHeight; maxItemHeight = 0; maxLineWidth = Math.max(maxLineWidth, lineWidth); lineWidth = 0; begin = true; }

这个判断,没有加上下个view所需的wordMargin,导致无法正确计算该行是不是可以正确显示下一条数据。

更正后应该是: if (maxWidth <= lineWidth + view.getMeasuredWidth() + mWordMargin) { contentHeight += mLineMargin; contentHeight += maxItemHeight; maxItemHeight = 0; maxLineWidth = Math.max(maxLineWidth, lineWidth); lineWidth = 0; begin = true; }

donkingliang commented 6 years ago

你好,你使用的是那个版本的。在1.4.1的版本,这个bug已经修复了。谢谢!