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
- Build
- Press buttons
- Pressing
Set Frame
button will toggle the frame to half size/full size.