This is a test app to demonstrate autolayout magicks. Please read the full document for autolayout tips and tricks.
There are six demo modes:
EMViewTypeDefault, // two labels vertically aligned EMViewTypePaddingExample, // two labels vertically aligned with padding EMViewTypeContainerExample, // two labels centered in a container view with padding on container view EMViewTypeFrameExample, // demonstrates that constraints keep relationships the same between views EMViewTypeOptionsExample, // three labels with different alignment options EMViewTypeMaskExample, // labels that use autoresizingMask
You can see how the layout constraints are set up here.
- git clone https://github.com/mona-zsh/EMAutolayout.git
- Open project in XCode
- Press buttons
Set Framebutton will toggle the frame to half size/full size.