mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +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:
@@ -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