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 margins methods taking percentage parameters #49

Merged
merged 12 commits into from
Dec 21, 2017

Conversation

lucdion
Copy link
Member

@lucdion lucdion commented Dec 19, 2017

Add margins methods taking percentage parameters:

  • marginTop(_ percent: FPercent)
    Top margin specify the offset the top edge of the item should have from it’s closest sibling (item) or parent (container).
  • marginLeft(_ percent: FPercent)
    Left margin specify the offset the left edge of the item should have from it’s closest sibling (item) or parent (container).
  • marginBottom(_ percent: FPercent)
    Bottom margin specify the offset the bottom edge of the item should have from it’s closest sibling (item) or parent (container)
  • marginRight(_ percent: FPercent)
    Right margin specify the offset the right edge of the item should have from it’s closest sibling (item) or parent (container).
  • marginStart(_ percent: FPercent)
    Set the start margin. In LTR direction, start margin specify the left margin. In RTL direction, start margin specify the right margin.
  • marginEnd(_ percent: FPercent)
    Set the end margin. In LTR direction, end margin specify the right margin. In RTL direction, end margin specify the left margin.
  • marginHorizontal(_ percent: FPercent)
    Set the left, right, start and end margins to the specified value.
  • marginVertical(_ percent: FPercent)
    Set the top and bottom margins to the specified value.
Usage examples:
  view.flex.margin(20%)
  view.flex.marginTop(20%).marginLeft(20%)
  view.flex.marginHorizontal(10%)

@lucdion lucdion changed the title Add margins methods + Fastlane Add margins methods taking percentage parameters Dec 21, 2017
@lucdion lucdion merged commit aff2812 into master Dec 21, 2017
@lucdion lucdion deleted the add_margin_percent_methods branch December 21, 2017 00:05
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.

1 participant