Skip to content

Commit 3d74605

Browse files
author
Shi Liang
committed
Beautify button
1 parent 040f568 commit 3d74605

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Sources/CodeScanner/ScannerViewController.swift

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,9 @@ extension CodeScannerView {
152152
private lazy var manualSelectButton: UIButton = {
153153
let button = UIButton(type: .system)
154154
let image = UIImage(systemName: "photo.on.rectangle")
155-
let background = UIImage(systemName: "rectangle.fill")?.withTintColor(.systemBackground, renderingMode: .alwaysOriginal)
155+
let background = UIImage(systemName: "capsule.fill")?.withTintColor(.systemBackground, renderingMode: .alwaysOriginal)
156156
button.setImage(image, for: .normal)
157157
button.setBackgroundImage(background, for: .normal)
158-
button.contentVerticalAlignment = .fill
159-
button.contentHorizontalAlignment = .fill
160-
button.contentEdgeInsets = UIEdgeInsets(top: 10, left: 5, bottom: 10, right: 5)
161158
button.addTarget(self, action: #selector(openGalleryFromButton), for: .touchUpInside)
162159
button.translatesAutoresizingMaskIntoConstraints = false
163160
return button
@@ -379,10 +376,10 @@ extension CodeScannerView {
379376
if manualSelectButton.superview == nil {
380377
view.addSubview(manualSelectButton)
381378
NSLayoutConstraint.activate([
382-
manualSelectButton.heightAnchor.constraint(equalToConstant: 60),
383-
manualSelectButton.widthAnchor.constraint(equalTo: manualSelectButton.heightAnchor),
379+
manualSelectButton.heightAnchor.constraint(equalToConstant: 50),
380+
manualSelectButton.widthAnchor.constraint(equalToConstant: 60),
384381
view.centerXAnchor.constraint(equalTo: manualSelectButton.centerXAnchor),
385-
view.safeAreaLayoutGuide.bottomAnchor.constraint(equalTo: manualSelectButton.bottomAnchor, constant: 64)
382+
view.safeAreaLayoutGuide.bottomAnchor.constraint(equalTo: manualSelectButton.bottomAnchor, constant: 32)
386383
])
387384
}
388385

0 commit comments

Comments
 (0)