AndroidFlowLayout
AndroidFlowLayout copied to clipboard
A mistake in onMeasure function.
There is a mistake in your code:
if (childLeft + childWidth + paddingRight > myWidth) {
childLeft = paddingLeft;
childTop += mVerticalSpacing + lineHeight;
lineHeight = childHeight;
Please change it to:
if (childLeft + childWidth + paddingRight > myWidth) {
childLeft = paddingLeft + childWidth;
childTop += mVerticalSpacing + lineHeight;
lineHeight = childHeight;
Sorry, have you ever run the code to see what happens if you changed the code like that ?
I agree with xyc112233 There is a mistake in the following code:
if (childLeft + childWidth + paddingRight > myWidth) {
childLeft = paddingLeft;
childTop += mVerticalSpacing + lineHeight;
lineHeight = childHeight;
} else {
childLeft += childWidth + mHorizontalSpacing;
}
change to : (This works well for me)
if (childLeft + childWidth + paddingRight > myWidth) {
childLeft = paddingLeft;
childTop += mVerticalSpacing + lineHeight;
lineHeight = childHeight;
}
childLeft += childWidth + mHorizontalSpacing;
When I use this library with scroll view it is not functioning correctly.Can I use this for flow layout inside Scroll view?
@sleepfin I agree with you
@xyc112233 √
博主,老外说的代码问题,确实是,外层如果有ScrollView就会出现显示不全