Salut je suis d'ajouter programmaticaly des vues comme ce problèmeProblème avec des vues programmatiques ajoutés
let xPos = (self.view.frame.size.width - 200)/2
self.headerLabel = UILabel(frame: CGRect(x: xPos, y: 50.0, width: 200.0, height: 100.0))
self.shopButton = UIButton(frame: CGRect(x: xPos, y: 150.0, width: 200.0, height: 40.0))
self.createButton = UIButton(frame: CGRect(x: xPos, y: 230.0, width: 200.0, height: 40.0))
self.orLabel = UILabel(frame: CGRect(x: xPos, y: 200.0, width: 200.0, height: 20.0))
est quand je tourne appareil au mode paysage et vice versa mes vues sont alignés sur le côté gauche. Comment puis-je l'empêcher?
Vous pouvez trouver une bonne documentation/après il: http://stackoverflow.com/questions/27473810/how-to-change-layout-constraints-programmatically-on -display-rotation et là https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/AutolayoutPG/WorkingwithConstraintsinInterfaceBuidler.html – Balanced