PhilippeBoisney / AlertOnboarding

A simple and attractive AlertView to onboard your users in your amazing world.
MIT License
842 stars 109 forks source link

Alert dark background incorrect size after rotation #3

Closed xradeon closed 8 years ago

xradeon commented 8 years ago

When I rotate the device the background doesn't size correctly.

I made the next changes to fix the issue:

    //Constraints for background
    let widthContraintsForBackground = NSLayoutConstraint(item: self.background, attribute:.Width, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: UIScreen.mainScreen().bounds.width)
    let heightConstraintForBackground = NSLayoutConstraint.init(item: self.background, attribute: .Height, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: UIScreen.mainScreen().bounds.height)

to

    //Constraints for background
    let widthContraintsForBackground = NSLayoutConstraint(item: self.background, attribute:.Width, relatedBy: .Equal, toItem: superView, attribute: .Width, multiplier: 1, constant: 0)
    let heightConstraintForBackground = NSLayoutConstraint.init(item: self.background, attribute: .Height, relatedBy: .Equal, toItem: superView, attribute: .Height, multiplier: 1, constant: 0)
PhilippeBoisney commented 8 years ago

I've just fixed it on release 1.5. Thank you for your help :)