diff --git a/ScrollPager/Base.lproj/Main.storyboard b/ScrollPager/Base.lproj/Main.storyboard index 7388370..b89ea5a 100644 --- a/ScrollPager/Base.lproj/Main.storyboard +++ b/ScrollPager/Base.lproj/Main.storyboard @@ -1,7 +1,8 @@ - + - + + @@ -20,7 +21,7 @@ - + @@ -102,6 +103,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -111,15 +148,23 @@ + + + + + + + + @@ -133,11 +178,9 @@ + - - - @@ -148,12 +191,19 @@ - - - + + + + + + + + + + @@ -168,33 +218,40 @@ + - - - + + + + + + + + + + - - - + + diff --git a/ScrollPager/Source/ScrollPager.swift b/ScrollPager/Source/ScrollPager.swift index aba78f1..411f1cf 100644 --- a/ScrollPager/Source/ScrollPager.swift +++ b/ScrollPager/Source/ScrollPager.swift @@ -77,6 +77,10 @@ import UIKit didSet { redrawComponents() } } + @IBInspectable public var indicatorHeightShouldAdjustButtonHeight: Bool = true { + didSet { redrawComponents() } + } + @IBInspectable public var borderColor: UIColor? { didSet { self.layer.borderColor = borderColor?.CGColor } } @@ -187,8 +191,8 @@ import UIKit } addSubview(button) - addSubview(indicatorView) } + insertSubview(indicatorView, atIndex: 0) } private func moveToIndex(index: Int, animated: Bool, moveScrollView: Bool) { @@ -245,7 +249,7 @@ import UIKit } let width = frame.size.width / CGFloat(buttons.count) - let height = frame.size.height - indicatorHeight + let height = frame.size.height - (indicatorHeightShouldAdjustButtonHeight ? indicatorHeight : 0) for i in 0..