You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been faced several times with a very strange issue, but which seems pretty logical to me: I end up with the last row being hidden if (number of items / number of columns) gives any result with < ,5
Example : 10 items, 3 columns = 3 rows (outch...)
This is due to this line (but after a bit of research, it may be a wider issue of how things get rounded, even for columns). In the following line, 10/3 = 3 as the standard float => just removes the float part of the integer, while to get the number of rows you need to ceil it. Maybe I'm missing some "config" point of the project ? :
Hi,
I've been faced several times with a very strange issue, but which seems pretty logical to me: I end up with the last row being hidden if (number of items / number of columns) gives any result with < ,5
Example : 10 items, 3 columns = 3 rows (outch...)
This is due to this line (but after a bit of research, it may be a wider issue of how things get rounded, even for columns). In the following line, 10/3 = 3 as the standard float => just removes the float part of the integer, while to get the number of rows you need to ceil it. Maybe I'm missing some "config" point of the project ? :
{
return _gridData.numberOfItems / _flags.numColumns;
}
My solution :
{
return (NSUInteger)ceilf((CGFloat)_gridData.numberOfItems / (CGFloat)_flags.numColumns );
}
The text was updated successfully, but these errors were encountered: