From 791b3579e1a8231d721eb8106bb4f9dc44c742bd Mon Sep 17 00:00:00 2001 From: hanshunli001 Date: Fri, 31 Dec 2021 15:28:10 +0800 Subject: [PATCH] =?UTF-8?q?bug=20fixed:=20=E5=8F=AA=E6=9C=89=E4=B8=80?= =?UTF-8?q?=E8=A1=8C=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B,=20=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/lcw/view/flowlayout/FlowLayout.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/lcw/view/flowlayout/FlowLayout.java b/app/src/main/java/com/lcw/view/flowlayout/FlowLayout.java index 58a8f93..0021507 100644 --- a/app/src/main/java/com/lcw/view/flowlayout/FlowLayout.java +++ b/app/src/main/java/com/lcw/view/flowlayout/FlowLayout.java @@ -100,6 +100,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { //当前行宽+子View+左右外边距<=ViewGroup的宽度,不换行 currentLineWidth += childViewWidth; currentLineHeight = Math.max(currentLineHeight, childViewHeight); + viewGroupWidth = Math.max(currentLineWidth, viewGroupWidth); //添加行对象里的子View lineView.add(childView); } @@ -109,7 +110,6 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { //最后一个子View的时候 //添加行对象 mLineViews.add(lineView); - viewGroupWidth = Math.max(childViewWidth, viewGroupWidth); viewGroupHeight += childViewHeight; //添加行高 mLineHeight.add(currentLineHeight);