I spend a day to learn how to make auto layout in iOS. I begin with an article How to use UIViews with auto layout programmatically. It teaches me add views from the first then add size constraints and position contraints later. They are using
After that, I find a thread at StackOverflow. They show off 3 ways to make Auto Layout programmatically
- Pure Classic style, which use NSLayoutConstraint with direct params
- Pure Visual Format Language style, which use
NSLayoutConstraint.constraintsWithVisualFormat()and Visually Format Languague. You can find more information about it at Apple Library
- Mixed style (Classic + Visual Format Language)
I also try to apply to Career 365 splashscreen but It doesn’t seem to be working. Struggling about an hour, finally I decide to find some more help from community and I find out Cartography. It’s such a good library which has about 1k5 stars from Github Users. Their syntax are good too. I think I should give it a try tmr.
1 2 3 4 5 6 7 8 9 10 11