Manos Chorianopoulos

fix header back button size

......@@ -13,9 +13,9 @@ extension UIViewController {
let backButton = UIButton(type: UIButton.ButtonType.custom) as UIButton
if (icon == "ic_close") {
backButton.frame = CGRect(x: 0, y: 0, width: uiscreen.height * 0.025, height: uiscreen.height * 0.025)
backButton.frame = CGRect(x: 0, y: 0, width: uiscreen.height * 0.035, height: uiscreen.height * 0.035)
} else {
backButton.frame = CGRect(x: 0, y: 0, width: uiscreen.height * 0.025, height: uiscreen.height * 0.02)
backButton.frame = CGRect(x: 0, y: 0, width: uiscreen.height * 0.035, height: uiscreen.height * 0.03)
}
backButton.imageView!.contentMode = .scaleAspectFit
//backButton.setBackgroundImage(UIImage(named:Assets.Navigation.backButton), for: UIControlState())
......@@ -27,12 +27,12 @@ extension UIViewController {
backButton.translatesAutoresizingMaskIntoConstraints = false
// Add width, height constraints
if (icon == "ic_close") {
let widthContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: uiscreen.height * 0.025)
let heightContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: uiscreen.height * 0.025)
let widthContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: uiscreen.height * 0.035)
let heightContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: uiscreen.height * 0.035)
NSLayoutConstraint.activate([heightContraints,widthContraints])
} else {
let widthContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: uiscreen.height * 0.025)
let heightContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: uiscreen.height * 0.02)
let widthContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: uiscreen.height * 0.035)
let heightContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: uiscreen.height * 0.03)
NSLayoutConstraint.activate([heightContraints,widthContraints])
}
......