diff --git a/Sources/ButtonBarPagerTabStripViewController.swift b/Sources/ButtonBarPagerTabStripViewController.swift index 36e008d6..d698a57c 100644 --- a/Sources/ButtonBarPagerTabStripViewController.swift +++ b/Sources/ButtonBarPagerTabStripViewController.swift @@ -49,9 +49,9 @@ public struct ButtonBarPagerTabStripSettings { public var buttonBarRightContentInset: CGFloat? public var selectedBarBackgroundColor = UIColor.black - public var selectedBarHeight: CGFloat = 5 + public var selectedBarHeight: CGFloat = 2 public var selectedBarVerticalAlignment: SelectedBarVerticalAlignment = .bottom - + public var selectedBarAlignment: SelectedBarAlignment = .center public var buttonBarItemBackgroundColor: UIColor? public var buttonBarItemFont = UIFont.systemFont(ofSize: 18) public var buttonBarItemLeftRightMargin: CGFloat = 8 diff --git a/Sources/ButtonBarView.swift b/Sources/ButtonBarView.swift index a204971e..146ee860 100644 --- a/Sources/ButtonBarView.swift +++ b/Sources/ButtonBarView.swift @@ -51,7 +51,7 @@ open class ButtonBarView: UICollectionView { return bar }() - internal var selectedBarHeight: CGFloat = 4 { + internal var selectedBarHeight: CGFloat = 2 { didSet { updateSelectedBarYPosition() } @@ -99,7 +99,7 @@ open class ButtonBarView: UICollectionView { targetFrame.size.height = selectedBar.frame.size.height targetFrame.size.width += (toFrame.size.width - fromFrame.size.width) * progressPercentage targetFrame.origin.x += (toFrame.origin.x - fromFrame.origin.x) * progressPercentage - + targetFrame.size.width = 76 selectedBar.frame = CGRect(x: targetFrame.origin.x, y: selectedBar.frame.origin.y, width: targetFrame.size.width, height: selectedBar.frame.size.height) var targetContentOffset: CGFloat = 0.0 @@ -122,7 +122,7 @@ open class ButtonBarView: UICollectionView { updateContentOffset(animated: animated, pagerScroll: pagerScroll, toFrame: selectedCellFrame, toIndex: (selectedCellIndexPath as NSIndexPath).row) - selectedBarFrame.size.width = selectedCellFrame.size.width + selectedBarFrame.size.width = 76 selectedBarFrame.origin.x = selectedCellFrame.origin.x if animated { @@ -179,7 +179,7 @@ open class ButtonBarView: UICollectionView { case .bottom: selectedBarFrame.origin.y = frame.size.height - selectedBarHeight } - + selectedBarFrame.size.width = 76 selectedBarFrame.size.height = selectedBarHeight selectedBar.frame = selectedBarFrame } diff --git a/Sources/ButtonCell.xib b/Sources/ButtonCell.xib index 7025bc70..8f55c8b7 100644 --- a/Sources/ButtonCell.xib +++ b/Sources/ButtonCell.xib @@ -1,11 +1,9 @@ - - - - + + - + @@ -19,7 +17,7 @@