Skip to content

Commit 16c3b82

Browse files
committed
Use contentView to evaluate height of the row, not the stackview itself
1 parent 92e4d62 commit 16c3b82

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Sources/ScrollStackController/ScrollStackRow.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,6 @@ open class ScrollStackRow: UIView, UIGestureRecognizerDelegate {
130130
didSet {
131131
separatorView.isHidden = isSeparatorHidden
132132
}
133-
// get {
134-
// return separatorView.isHidden
135-
// }
136-
// set {
137-
// separatorView.isHidden = newValue
138-
// }
139133
}
140134

141135
// MARK: Private Properties
@@ -367,14 +361,14 @@ open class ScrollStackRow: UIView, UIGestureRecognizerDelegate {
367361

368362
var bestSize: CGSize!
369363
if stackView.axis == .vertical {
370-
let maxAllowedSize = CGSize(width: stackView.bounds.size.width, height: 0)
364+
let maxAllowedSize = CGSize(width: contentView.bounds.width, height: 0)
371365
bestSize = contentView.systemLayoutSizeFitting(
372366
maxAllowedSize,
373367
withHorizontalFittingPriority: .required,
374368
verticalFittingPriority: .fittingSizeLevel
375369
)
376370
} else {
377-
let maxAllowedSize = CGSize(width: 0, height: stackView.bounds.size.height)
371+
let maxAllowedSize = CGSize(width: 0, height: contentView.bounds.height)
378372
bestSize = contentView.systemLayoutSizeFitting(
379373
maxAllowedSize,
380374
withHorizontalFittingPriority: .fittingSizeLevel,

0 commit comments

Comments
 (0)