~buzzert/rossler.attix#9: Tabs: Too hard to tap on close button
Fix up the margin on the button
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user