react-native-grid-view
react-native-grid-view copied to clipboard
Stretching
It is currently not creating a real grid. If my grid is 2 items per row and i have 5 items, the 5th item is rendered across the entire row rather than in it's own part of the grid. This makes for an annoying effect:
I changed the code with the following to add the prop "cleanGrid={true}"
if (group.length > 0) {
if (this.props.cleanGrid == true) {
while (group.length < itemsPerRow) {
group.push(null);
}
}
itemsGroups.push(group);
}
This will just push a null response for the amount of rows defined so that the user can check in the render item for null and return an empty container as needed. Not sure if there is a better way of handling this but it works!
@bradynapier nice work, I used your code.
+1 This should work by default. Please create a pull request.
@bradynapier Who to add the code? Would you give me the whole sources of index.js! I learn React for the first time,I don't know how to add the prop "cleanGrid={true}".