diff --git a/Segmentio/Source/Segmentio.swift b/Segmentio/Source/Segmentio.swift index 74c5638..a0b4f1f 100644 --- a/Segmentio/Source/Segmentio.swift +++ b/Segmentio/Source/Segmentio.swift @@ -113,6 +113,8 @@ open class Segmentio: UIView { let separatorHeight = horizontalSeparatorOptions.height switch horizontalSeparatorOptions.type { + case .none: + separatorsHeight = 0 case .top: collectionViewFrameMinY = separatorHeight separatorsHeight = separatorHeight @@ -252,7 +254,7 @@ open class Segmentio: UIView { bottomSeparatorView = UIView(frame: CGRect.zero) setupConstraintsForSeparatorView( separatorView: bottomSeparatorView, - originY: frame.maxY - height + originY: bounds.maxY - height ) } } @@ -270,7 +272,7 @@ open class Segmentio: UIView { item: separatorView, attribute: .top, relatedBy: .equal, - toItem: superview, + toItem: self, attribute: .top, multiplier: 1, constant: originY @@ -512,6 +514,8 @@ open class Segmentio: UIView { let isIndicatorTop = indicatorOptions.type == .top switch horizontalSeparatorOptions.type { + case .none: + break case .top: indicatorPointY = isIndicatorTop ? indicatorPointY + separatorHeight : indicatorPointY case .bottom: diff --git a/Segmentio/Source/SegmentioOptions.swift b/Segmentio/Source/SegmentioOptions.swift index 2ca66ca..8ed23d9 100644 --- a/Segmentio/Source/SegmentioOptions.swift +++ b/Segmentio/Source/SegmentioOptions.swift @@ -58,7 +58,7 @@ public struct SegmentioState { // MARK: - Horizontal separator public enum SegmentioHorizontalSeparatorType { - + case none case top case bottom case topAndBottom