Open kaylanx opened 10 years ago
It seems that if I try and use the
-UIViewShowAlignmentRects YES
Setting in my app, then RZCellSizeManager doesn't work properly, and goes into an infinite loop.
Commenting out the layoutIfNeeded, seems to fix it...
(NSNumber )cellHeightForObject:(id)object configuration:(RZCellSizeManagerCellConfiguration *)configuration { NSNumber height = nil; if (configuration) { if (configuration.configurationBlock) { [configuration.cell prepareForReuse]; configuration.configurationBlock(configuration.cell, object); // [configuration.cell layoutIfNeeded]; UIView* contentView = [configuration.cell contentView]; height = @([contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height + self.cellHeightPadding); } else if (configuration.heightBlock) { height = @(configuration.heightBlock(configuration.cell, object) + self.cellHeightPadding); }
} return height;
}
@kaylanx If commenting out layoutIfNeeded works consistently even without alignment rects turned on, please open a pull request to fix the issue. Thanks.
layoutIfNeeded
It seems that if I try and use the
-UIViewShowAlignmentRects YES
Setting in my app, then RZCellSizeManager doesn't work properly, and goes into an infinite loop.
Commenting out the layoutIfNeeded, seems to fix it...
(NSNumber )cellHeightForObject:(id)object configuration:(RZCellSizeManagerCellConfiguration *)configuration { NSNumber height = nil; if (configuration) { if (configuration.configurationBlock) { [configuration.cell prepareForReuse]; configuration.configurationBlock(configuration.cell, object); // [configuration.cell layoutIfNeeded]; UIView* contentView = [configuration.cell contentView]; height = @([contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height + self.cellHeightPadding); } else if (configuration.heightBlock) { height = @(configuration.heightBlock(configuration.cell, object) + self.cellHeightPadding); }
} return height;
}