mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-03 18:56:14 +00:00
Fixes close button icon distortion
This bug was caused by an inaccessible property of UIButton. Since the button was setup in IB using a system button with a custom icon, it’s imageView property is only accessible in code. The “view” content-mode in IB is misleading here, as it affects the UIButton.view NOT UIButton.ImageView. - Set content-mode of the buttons imageview to scaleAspectFit.
This commit is contained in:
1 parent
feacda1c3b
commit
da64f65c7b
2 files changed
+12
-2
No files matched your search
@@ -10,6 +10,8 @@ import UIKit
|
||||
|
||||
class ImageViewController: UIViewController {
|
||||
|
||||
|
||||
@IBOutlet weak var closeButton: UIButton!
|
||||
@IBOutlet weak var shareButton: UIButton!
|
||||
@IBOutlet weak var imageScrollView: ImageScrollView!
|
||||
@IBOutlet weak var titleLabel: UILabel!
|
||||
@@ -26,6 +28,8 @@ class ImageViewController: UIViewController {
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
closeButton.imageView?.contentMode = .scaleAspectFit
|
||||
|
||||
imageScrollView.setup()
|
||||
imageScrollView.imageScrollViewDelegate = self
|
||||
imageScrollView.imageContentMode = .aspectFit
|
||||
@@ -58,6 +62,9 @@ class ImageViewController: UIViewController {
|
||||
}
|
||||
|
||||
@IBAction func done(_ sender: Any) {
|
||||
if let button = sender as? UIButton {
|
||||
print(button.frame.size)
|
||||
}
|
||||
dismiss(animated: true)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user