ios swift development


NSLayoutConstraint-1.Layout an UIVIew with fixed dimension and center of main view


Hide/Show description

This video shows you how to layout a custom view with fixed width/height, this view also at center(x, y) of the controller's view.These are main steps: 1. Create a new swift Xcode project, add a new UINavigationViewController and a MainViewController as rootViewController. 2.Add a centerView to MainViewController with translateAutoresizingMaskIntoContraints is false. 3. add Constraint to layout centerView with weight=150px, height = 100px; 4. Add layout constraint to centerX and centerY for the centerView with the ViewController's view You can see other videos at my channel: https://www.youtube.com/c/NguyenDucHoang Twitter: https://twitter.com/NguyenD97601913 Facebook: https://www.facebook.com/nguyen.duc.hoang.bk