Let's make a basic autolayout example.
Firstly add a blue view the upper left corner.Add the constraints for the blue view
height = 100
width = 100
Seconly, add a purple view the center
Add the constraints for the purple view
height = 200
width = 200
In order to show a view on the center, we must add alignment constraints:
1. Horizontal center in Container
2. Vertical center in Container
Finally add a orange view the upper left corner.
Add the constraints for the orange view
height = 100
width = 100
Update Frames for orange view
Let's control storyboard preview for iPhone sizes.
Result for iPhone 6
You can download from https://github.com/ozlemakalin/BasicAutoLayoutExample
Hiç yorum yok:
Yorum Gönder