Fix for CXTDT-597984, Fixing the padding issue while calculating the itemwidth which is causing the issue.
This commit is contained in:
parent
0951a48467
commit
93b89ee754
@ -112,8 +112,7 @@ class MatrixFlowLayout : UICollectionViewFlowLayout {
|
|||||||
|
|
||||||
/// Fetches estimated height by calling the cell's component estimated height and adding padding
|
/// Fetches estimated height by calling the cell's component estimated height and adding padding
|
||||||
private func estimateHeightFor(item: TableItemModel, with width: CGFloat, index: IndexPath) -> CGFloat {
|
private func estimateHeightFor(item: TableItemModel, with width: CGFloat, index: IndexPath) -> CGFloat {
|
||||||
let horizontalPadding = (index.row == 0 && !striped) ? (VDSLayout.space1X + layoutPadding.horizontalValue()) : (2 * layoutPadding.horizontalValue())
|
let itemWidth = width - layoutPadding.horizontalValue() - (index.row == 0 ? defaultLeadingPadding:layoutPadding.horizontalValue())
|
||||||
let itemWidth = width - layoutPadding.horizontalValue() - defaultLeadingPadding
|
|
||||||
let maxSize = CGSize(width: itemWidth, height: CGFloat.greatestFiniteMagnitude)
|
let maxSize = CGSize(width: itemWidth, height: CGFloat.greatestFiniteMagnitude)
|
||||||
let estItemSize = item.component?.systemLayoutSizeFitting(maxSize, withHorizontalFittingPriority: .required, verticalFittingPriority: .fittingSizeLevel) ?? CGSize(width: itemWidth, height: item.defaultHeight)
|
let estItemSize = item.component?.systemLayoutSizeFitting(maxSize, withHorizontalFittingPriority: .required, verticalFittingPriority: .fittingSizeLevel) ?? CGSize(width: itemWidth, height: item.defaultHeight)
|
||||||
return estItemSize.height + (2 * layoutPadding.verticalValue())
|
return estItemSize.height + (2 * layoutPadding.verticalValue())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user