Skip to content

Commit

Permalink
fix: QMUIFloatLayout 居左布局时换行时的Y轴偏移值计算错误 #61
Browse files Browse the repository at this point in the history
  • Loading branch information
chanthuang committed Oct 10, 2017
1 parent eaf70d5 commit 4a0f13c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,15 @@ private void layoutWithGravityLeft(int parentWidth) {
}
final int childw = child.getMeasuredWidth();
final int childh = child.getMeasuredHeight();
lineHeight = Math.max(lineHeight, childh);
if (childPositionX + childw > childMaxRight) {
// 换行
childPositionX = getPaddingLeft();
childPositionY += (lineHeight + mChildVerticalSpacing);
lineHeight = 0;
}
child.layout(childPositionX, childPositionY, childPositionX + childw, childPositionY + childh);
childPositionX += childw + mChildHorizontalSpacing;
lineHeight = Math.max(lineHeight, childh);
}

// 如果布局的子View少于childCount,则表示有一些子View不需要布局
Expand Down

0 comments on commit 4a0f13c

Please sign in to comment.