From 439c66fb97135da70a5b797841e5a057c93f6ff1 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 8 Jun 2023 08:56:04 -0500 Subject: [PATCH] fixed bug for borderline in horizontal - top configuration Signed-off-by: Matt Bruce --- VDS/Components/Tabs/Tabs.swift | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/VDS/Components/Tabs/Tabs.swift b/VDS/Components/Tabs/Tabs.swift index 76843585..0ecd12da 100644 --- a/VDS/Components/Tabs/Tabs.swift +++ b/VDS/Components/Tabs/Tabs.swift @@ -104,7 +104,7 @@ open class Tabs: View { private var tabStackView: UIStackView! private var scrollView: UIScrollView! private var contentView: View! - private var borderlineColorConfig = SurfaceColorConfiguration(VDSColor.elementsLowcontrastOnlight, VDSColor.elementsLowcontrastOndark) + private var borderlineColorConfiguration = SurfaceColorConfiguration(VDSColor.elementsLowcontrastOnlight, VDSColor.elementsLowcontrastOndark) private var contentViewWidthConstraint: NSLayoutConstraint? //-------------------------------------------------- @@ -255,20 +255,16 @@ open class Tabs: View { scrollView.contentSize = bounds.size } - // Apply border line - layer.remove(layerName: "borderLineLayer") + //borderLine + removeBorders() if borderLine { - let borderLineLayer = CALayer() - borderLineLayer.name = "borderLineLayer" - borderLineLayer.backgroundColor = borderlineColorConfig.getColor(self).cgColor - - if orientation == .horizontal { - borderLineLayer.frame = CGRect(x: 0, y: bounds.height - 1, width: bounds.width, height: 1) - } else { - borderLineLayer.frame = CGRect(x: 0, y: 0, width: 1, height: bounds.height) + var edge: UIRectEdge = .bottom + if orientation == .vertical { + edge = .left + } else if indicatorPosition == .top { + edge = .top } - - layer.addSublayer(borderLineLayer) + addBorder(side: edge, width: 1, color: borderlineColorConfiguration.getColor(self)) } scrollToSelectedIndex(animated: true)