Manos Chorianopoulos

PopupInfoViewController ui fixes

......@@ -8,6 +8,7 @@
import UIKit
class PopupInfoViewController: UIViewController {
@IBOutlet weak var containerView: UIView!
@IBOutlet weak var popupView: UIView!
@IBOutlet weak var headerLabel: UILabel!
@IBOutlet weak var headerCloseButton: UIButton!
......@@ -18,29 +19,33 @@ class PopupInfoViewController: UIViewController {
super.viewDidLoad()
// Add arrow programmatically
let arrowSize = CGSize(width: 30, height: 15) // Width and height of the arrow
let arrowView = ArrowView(frame: CGRect(x: (self.view.frame.width - arrowSize.width) / 2,
y: popupView.frame.minY - arrowSize.height,
width: arrowSize.width,
height: arrowSize.height))
let arrowSize = CGSize(width: 15, height: 7.5) // Width and height of the arrow
let arrowView = ArrowView(frame: CGRect(
x: (popupView.frame.width - arrowSize.width - 35),
y: popupView.frame.minY - arrowSize.height,
width: arrowSize.width,
height: arrowSize.height))
self.view.addSubview(arrowView)
self.view.bringSubviewToFront(popupView)
containerView.addSubview(arrowView)
// containerView.bringSubviewToFront(popupView)
// Add shadow
containerView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.57).cgColor
containerView.layer.shadowOffset = CGSize(width: 0.0, height: 3.0)
containerView.layer.shadowOpacity = 1.0
containerView.layer.shadowRadius = 20.0
containerView.layer.masksToBounds = false
containerView.backgroundColor = .clear
popupView.backgroundColor = UIColor(rgb: 0xE6E6E6)
popupView.layer.cornerRadius = 14
// Add shadow
popupView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.57).cgColor
popupView.layer.shadowOffset = CGSize(width: 0.0, height: 3.0)
popupView.layer.shadowOpacity = 1.0
popupView.layer.shadowRadius = 20.0
headerLabel.font = UIFont(name: "BTCosmo-Bold", size: 17)
headerLabel.textColor = UIColor(rgb: 0x212121)
headerLabel.text = "SUPERMARKET DEALS"
headerCloseButton.setImage(UIImage(named: "ic_close_3.png", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
headerCloseButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
headerCloseButton.imageView?.layer.transform = CATransform3DMakeScale(1.3, 1.3, 1.3)
infoLabel.font = UIFont(name: "PeridotPE-Regular", size: 16.0)
infoLabel.textColor = UIColor(rgb: 0x212121)
......@@ -52,15 +57,6 @@ class PopupInfoViewController: UIViewController {
submitButton.frame.size.width = submitButton.intrinsicContentSize.width
}
func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle {
return UIModalPresentationStyle.none
}
func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle {
// return UIModalPresentationStyle.FullScreen
return UIModalPresentationStyle.none
}
// MARK: - Actions
@IBAction func headerCloseButtonAction(_ sender: Any) {
self.dismiss(animated: true, completion: {})
......