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)