From 509cf66e180cb7bb0945d90dd7043371264b21e6 Mon Sep 17 00:00:00 2001 From: James Magahern Date: Thu, 29 Oct 2020 15:19:59 -0700 Subject: [PATCH] ~buzzert/rossler.attix#9: Tabs: Too hard to tap on close button Fix up the margin on the button --- App/Tabs/TabBarView.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/App/Tabs/TabBarView.swift b/App/Tabs/TabBarView.swift index 0b47213..dcb9704 100644 --- a/App/Tabs/TabBarView.swift +++ b/App/Tabs/TabBarView.swift @@ -26,6 +26,7 @@ class TabView: UIControl addSubview(closeButton) closeButton.setImage(UIImage(systemName: "xmark.square.fill"), for: .normal) + closeButton.imageView?.contentMode = .center closeButton.tintColor = .label addSubview(leftSeparator) @@ -43,9 +44,9 @@ class TabView: UIControl let insetBounds = bounds.inset(by: layoutMargins) let closeButtonPadding = CGFloat(5.0) - let closeButtonSize = CGSize(width: insetBounds.height, height: insetBounds.height) + let closeButtonSize = CGSize(width: bounds.height, height: bounds.height) closeButton.frame = CGRect( - x: insetBounds.width - closeButtonSize.width, y: insetBounds.minY, + x: insetBounds.width - closeButtonSize.height, y: 0.0, width: closeButtonSize.width, height: closeButtonSize.height )