Files
AsyncDisplayKit/appledoc/Protocols/ASLayoutable.html
2015-09-16 14:54:25 +03:00

654 lines
15 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ASLayoutable Protocol Reference</title>
<link rel="stylesheet" href="../css/style.css">
<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
<meta name="generator" content="appledoc 2.2.1 (build 1333)">
</head>
<body class="appledoc">
<header>
<div class="container" class="hide-in-xcode">
<h1 id="library-title">
<a href="../index.html">AsyncDisplayKit </a>
</h1>
<p id="developer-home">
<a href="../index.html">Facebook</a>
</p>
</div>
</header>
<aside>
<div class="container">
<nav>
<ul id="header-buttons" role="toolbar">
<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>
<li id="on-this-page" role="navigation">
<label>
On This Page
<div class="chevron">
<div class="chevy chevron-left"></div>
<div class="chevy chevron-right"></div>
</div>
<select id="jump-to">
<option value="top">Jump To&#133;</option>
<option value="overview">Overview</option>
<option value="tasks">Tasks</option>
<optgroup label="Properties">
<option value="//api/name/alignSelf">alignSelf</option>
<option value="//api/name/ascender">ascender</option>
<option value="//api/name/descender">descender</option>
<option value="//api/name/flexBasis">flexBasis</option>
<option value="//api/name/flexGrow">flexGrow</option>
<option value="//api/name/flexShrink">flexShrink</option>
<option value="//api/name/layoutPosition">layoutPosition</option>
<option value="//api/name/sizeRange">sizeRange</option>
<option value="//api/name/spacingAfter">spacingAfter</option>
<option value="//api/name/spacingBefore">spacingBefore</option>
</optgroup>
<optgroup label="Instance Methods">
<option value="//api/name/measureWithSizeRange:">- measureWithSizeRange:</option>
</optgroup>
</select>
</label>
</li>
</ul>
</nav>
</div>
</aside>
<article>
<div id="overview_contents" class="container">
<div id="content">
<main role="main">
<h1 class="title">ASLayoutable Protocol Reference</h1>
<div class="section section-specification"><table cellspacing="0"><tbody>
<tr>
<th>Conforms to</th>
<td><a href="../Protocols/ASLayoutablePrivate.html">ASLayoutablePrivate</a><br /><a href="../Protocols/ASStackLayoutable.html">ASStackLayoutable</a><br /><a href="../Protocols/ASStaticLayoutable.html">ASStaticLayoutable</a></td>
</tr><tr>
<th>Declared in</th>
<td>ASLayoutable.h</td>
</tr>
</tbody></table></div>
<div class="section section-overview">
<a title="Overview" name="overview"></a>
<h2 class="subtitle subtitle-overview">Overview</h2>
<p>The ASLayoutable protocol declares a method for measuring the layout of an object. A layout
is defined by an ASLayout return value, and must specify 1) the size (but not position) of the
layoutable object, and 2) the size and position of all of its immediate child objects. The tree
recursion is driven by parents requesting layouts from their children in order to determine their
size, followed by the parents setting the position of the children once the size is known</p>
<p>The protocol also implements a &ldquo;family&rdquo; of Layoutable protocols. These protocols contain layout
options that can be used for specific layout specs. For example, ASStackLayoutSpec has options
defining how a layoutable should shrink or grow based upon available space.</p>
<p>These layout options are all stored in an ASLayoutOptions class (that is defined in ASLayoutablePrivate).
Generally you needn&rsquo;t worry about the layout options class, as the layoutable protocols allow all direct
access to the options via convenience properties. If you are creating custom layout spec, then you can
extend the backing layout options class to accomodate any new layout options.</p>
</div>
<div class="section section-tasks">
<a title="Tasks" name="tasks"></a>
<div class="task-list">
<div class="section-method">
<a name="//api/name/measureWithSizeRange:" title="measureWithSizeRange:"></a>
<h3 class="method-title"><code><a href="#//api/name/measureWithSizeRange:">&ndash;&nbsp;measureWithSizeRange:</a></code>
<span class="task-item-suffix">required method</span></h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Calculate a layout based on given size range.</p>
</div>
<div class="method-subsection method-declaration"><code>- (ASLayout *)measureWithSizeRange:(ASSizeRange)<em>constrainedSize</em></code></div>
<div class="method-subsection arguments-section parameters">
<h4 class="method-subtitle parameter-title">Parameters</h4>
<table class="argument-def parameter-def">
<tr>
<th scope="row" class="argument-name"><code>constrainedSize</code></th>
<td><p>The minimum and maximum sizes the receiver should fit in.</p></td>
</tr>
</table>
</div>
<div class="method-subsection return">
<h4 class="method-subtitle parameter-title">Return Value</h4>
<p>An ASLayout instance defining the layout of the receiver and its children.</p>
</div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASLayoutable.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/spacingBefore" title="spacingBefore"></a>
<h3 class="method-title"><code><a href="#//api/name/spacingBefore">&nbsp;&nbsp;spacingBefore</a></code>
<span class="task-item-suffix">required method</span></h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Additional space to place before this object in the stacking direction.
Used when attached to a stack layout.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite) CGFloat spacingBefore</code></div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASLayoutable.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/spacingAfter" title="spacingAfter"></a>
<h3 class="method-title"><code><a href="#//api/name/spacingAfter">&nbsp;&nbsp;spacingAfter</a></code>
<span class="task-item-suffix">required method</span></h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Additional space to place after this object in the stacking direction.
Used when attached to a stack layout.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite) CGFloat spacingAfter</code></div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASLayoutable.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/flexGrow" title="flexGrow"></a>
<h3 class="method-title"><code><a href="#//api/name/flexGrow">&nbsp;&nbsp;flexGrow</a></code>
<span class="task-item-suffix">required method</span></h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>If the sum of childrens' stack dimensions is less than the minimum size, should this object grow?
Used when attached to a stack layout.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite) BOOL flexGrow</code></div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASLayoutable.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/flexShrink" title="flexShrink"></a>
<h3 class="method-title"><code><a href="#//api/name/flexShrink">&nbsp;&nbsp;flexShrink</a></code>
<span class="task-item-suffix">required method</span></h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>If the sum of childrens' stack dimensions is greater than the maximum size, should this object shrink?
Used when attached to a stack layout.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite) BOOL flexShrink</code></div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASLayoutable.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/flexBasis" title="flexBasis"></a>
<h3 class="method-title"><code><a href="#//api/name/flexBasis">&nbsp;&nbsp;flexBasis</a></code>
<span class="task-item-suffix">required method</span></h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Specifies the initial size in the stack dimension for this object.
Default to ASRelativeDimensionUnconstrained.
Used when attached to a stack layout.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite) ASRelativeDimension flexBasis</code></div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASLayoutable.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/alignSelf" title="alignSelf"></a>
<h3 class="method-title"><code><a href="#//api/name/alignSelf">&nbsp;&nbsp;alignSelf</a></code>
<span class="task-item-suffix">required method</span></h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Orientation of the object along cross axis, overriding alignItems
Used when attached to a stack layout.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite) ASStackLayoutAlignSelf alignSelf</code></div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASLayoutable.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/ascender" title="ascender"></a>
<h3 class="method-title"><code><a href="#//api/name/ascender">&nbsp;&nbsp;ascender</a></code>
<span class="task-item-suffix">required method</span></h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Used for baseline alignment. The distance from the top of the object to its baseline.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite) CGFloat ascender</code></div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASLayoutable.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/descender" title="descender"></a>
<h3 class="method-title"><code><a href="#//api/name/descender">&nbsp;&nbsp;descender</a></code>
<span class="task-item-suffix">required method</span></h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>Used for baseline alignment. The distance from the baseline of the object to its bottom.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite) CGFloat descender</code></div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASLayoutable.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/sizeRange" title="sizeRange"></a>
<h3 class="method-title"><code><a href="#//api/name/sizeRange">&nbsp;&nbsp;sizeRange</a></code>
<span class="task-item-suffix">required method</span></h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>If specified, the child&rsquo;s size is restricted according to this size. Percentages are resolved relative to the static layout spec.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) ASRelativeSizeRange sizeRange</code></div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASLayoutable.h</code></p>
</div>
</div>
</div>
</div><div class="section-method">
<a name="//api/name/layoutPosition" title="layoutPosition"></a>
<h3 class="method-title"><code><a href="#//api/name/layoutPosition">&nbsp;&nbsp;layoutPosition</a></code>
<span class="task-item-suffix">required method</span></h3>
<div class="method-info">
<div class="pointy-thing"></div>
<div class="method-info-container">
<div class="method-subsection brief-description">
<p>The position of this object within its parent spec.</p>
</div>
<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) CGPoint layoutPosition</code></div>
<div class="method-subsection declared-in-section">
<h4 class="method-subtitle">Declared In</h4>
<p><code class="declared-in-ref">ASLayoutable.h</code></p>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<footer>
<div class="footer-copyright">
<p class="copyright">Copyright &copy; 2015 Facebook. All rights reserved. Updated: 2015-09-16</p>
<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1333)</a>.</p>
</div>
</footer>
</div>
</div>
</article>
<script src="../js/script.js"></script>
</body>
</html>