flexbox-layout
flexbox-layout copied to clipboard
RecycleView nests RecycleView, and the internal RecycleView uses FlexboxLayoutManager(context, FlexDirection.ROW, FlexWrap.WRAP), when the number of items is large, it cannot be displayed completely (for example, only 30 items are displayed for 50 items, and they are not displayed after exceeding one screen)
Problem and steps to reproduce
RecycleView nests RecycleView, and the internal RecycleView uses FlexboxLayoutManager(context, FlexDirection.ROW, FlexWrap.WRAP), when the number of items is large, it cannot be displayed completely (for example, only 30 items are displayed for 50 items, and they are not displayed after exceeding one screen)。
But when FlexboxLayoutManager is set to FlexDirection.COLUMN. Vertical display can all be displayed, and LinearLayoutManager or GridLayoutManager can also be used to display all
Only when FlexboxLayoutManager is set to FlexDirection.ROW is not fully displayed
Version of the flexbox library 3.0.0 and earlier
I have the same problem,Is there a solution?
Same problem here, when the layout manager is changed, all items are visible again
Find FlexBoxHelper.java
if (sumCrossSize > needsCalcAmount && reachedToIndex) {
// Stop the calculation if the sum of cross size calculated reached to the point
// beyond the needsCalcAmount value to avoid unneeded calculation in a
// RecyclerView.
// To be precise, the decoration length may be added to the sumCrossSize,
// but we omit adding the decoration length because even without the decorator
// length, it's guaranteed that calculation is done at least beyond the
// needsCalcAmount
break;
}
Then comment out the If branch code above
if (sumCrossSize > needsCalcAmount && reachedToIndex) {
// Stop the calculation if the sum of cross size calculated reached to the point
// beyond the needsCalcAmount value to avoid unneeded calculation in a
// RecyclerView.
// To be precise, the decoration length may be added to the sumCrossSize,
// but we omit adding the decoration length because even without the decorator
// length, it's guaranteed that calculation is done at least beyond the
// needsCalcAmount
// break;
}
Having same problem , Is there any solution?