Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/main/java/com/lcw/view/flowlayout/FlowLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
Expand Down