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 missing </div> tags in Layout API Sizing docs #691

Merged
merged 1 commit into from
Nov 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/_docs/layout2-api-sizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The easiest way to understand the compound dimension types in the Layout API is
<img src="/static/images/layout2-api-sizing.png">

## Values (`CGFloat`, `ASDimension`)
<br>

`ASDimension` is essentially a **normal CGFloat with support for representing either a point value, a relative percentage value, or an auto value**.

This unit allows the same API to take in both fixed values, as well as relative ones.
Expand Down Expand Up @@ -41,6 +41,8 @@ ASDimensionMake("70pt")
ASDimensionMake(70)
ASDimensionMakeWithPoints(70)
</pre>
</div>
</div>

### Example using `ASDimension`

Expand Down Expand Up @@ -68,8 +70,10 @@ self.rightStack.style.flexBasis = ASDimensionMake(@"60%");
self.leftStack.style.flexBasis = ASDimensionMake("40%")
self.rightStack.style.flexBasis = ASDimensionMake("60%")

horizontalStack.children = [self.leftStack, self.rightStack]]
horizontalStack.children = [self.leftStack, self.rightStack]
</pre>
</div>
</div>

## Sizes (`CGSize`, `ASLayoutSize`)

Expand Down Expand Up @@ -187,5 +191,4 @@ func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec
</div>
</div>

<br>
The `constrainedSize` passed to an `ASDisplayNode` subclass' `layoutSpecThatFits:` method is the minimum and maximum sizes that the node should fit in. The minimum and maximum `CGSize`s contained in `constrainedSize` can be used to size the node's layout elements.