Fix for variable row heights when initial setup of the tableview had zero rows

This commit is contained in:
Randall Luecke
2011-01-06 14:50:40 -06:00
parent c071569f3c
commit 477e9f85be
+5 -5
View File
@@ -2053,18 +2053,17 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
if (!(_implementedDelegateMethods & CPTableViewDelegate_tableView_heightOfRow_))
var height = (_rowHeight + _intercellSpacing.height) * _numberOfRows;
else if ([self numberOfRows] === 0)
var height = 0;
else
{
// if this is the fist run we need to populate the cache
if ([self numberOfRows] !== _cachedRowHeights.length)
[self noteHeightOfRowsWithIndexesChanged:[CPIndexSet indexSetWithIndexesInRange:CPMakeRange(0, [self numberOfRows])]];
var heightObject = _cachedRowHeights[_cachedRowHeights.length - 1];
if (heightObject)
var heightObject = _cachedRowHeights[_cachedRowHeights.length - 1],
height = heightObject.heightAboveRow + heightObject.height + _intercellSpacing.height;
else
height = 0;
}
@@ -2082,6 +2081,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
[self setNeedsDisplay:YES];
}
/*!
Scrolls the receiver vertically in an enclosing CPClipView so the row specified by rowIndex is visible.