Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the possibility to wrap the stack view within the superview's layout margins #36

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

alexbredy
Copy link
Contributor

@alexbredy alexbredy commented Feb 1, 2019

This pull request adds the ability to AloeStackView to adapt its insets to the superview's layout margins.

Motivations:

  • Avoid to explicitly set the default margin when we want to inherit from the superview margins
  • Automatic support for universal apps (iPhone and iPad can have different layout margins)

An example ViewController has been added to showcase this. The screenshot below comes from that VC. The default insets are set to 0. The existing margin is the one that the superview defines.

Most of the lines in this PR are related to the example. The actual trick is done by overriding the preservesSuperviewLayoutMargins property of AloeStackView/UIScrollView.

@larryonoff
Copy link

This's really useful request. Could anyone with write access review it?

alexbredy and others added 2 commits June 3, 2019 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants