From 60d3c792c69a976d6431b00957fccfd88f17dc7d Mon Sep 17 00:00:00 2001 From: coffmark Date: Sun, 22 Jan 2023 23:16:18 +0900 Subject: [PATCH] add padding to the bottom of the selectedBar --- Sources/ButtonBarView.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/ButtonBarView.swift b/Sources/ButtonBarView.swift index a204971e..582ca8e6 100644 --- a/Sources/ButtonBarView.swift +++ b/Sources/ButtonBarView.swift @@ -41,6 +41,7 @@ public enum SelectedBarVerticalAlignment { case top case middle case bottom + case customBottom(spaceFromBottom: CGFloat) } open class ButtonBarView: UICollectionView { @@ -178,6 +179,8 @@ open class ButtonBarView: UICollectionView { selectedBarFrame.origin.y = (frame.size.height - selectedBarHeight) / 2 case .bottom: selectedBarFrame.origin.y = frame.size.height - selectedBarHeight + case .customBottom(let spaceFromBottom): + selectedBarFrame.origin.y = frame.size.height - selectedBarHeight - spaceFromBottom } selectedBarFrame.size.height = selectedBarHeight