mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-05-06 08:01:19 +08:00
678 lines
18 KiB
HTML
678 lines
18 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
|
|
<title>ASImageNode Class Reference</title>
|
|
<meta id="xcode-display" name="xcode-display" content="render"/>
|
|
<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
|
|
<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
|
|
<meta name="generator" content="appledoc 2.2 (build 963)" />
|
|
</head>
|
|
<body>
|
|
<header id="top_header">
|
|
<div id="library" class="hideInXcode">
|
|
<h1><a id="libraryTitle" href="../index.html">AsyncDisplayKit </a></h1>
|
|
<a id="developerHome" href="../index.html">Facebook</a>
|
|
</div>
|
|
|
|
<div id="title" role="banner">
|
|
<h1 class="hideInXcode">ASImageNode Class Reference</h1>
|
|
</div>
|
|
<ul id="headerButtons" role="toolbar">
|
|
<li id="toc_button">
|
|
<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
|
|
</li>
|
|
<li id="jumpto_button" role="navigation">
|
|
<select id="jumpTo">
|
|
<option value="top">Jump To…</option>
|
|
|
|
<option value="overview">Overview</option>
|
|
|
|
|
|
|
|
|
|
<option value="tasks">Tasks</option>
|
|
|
|
|
|
|
|
|
|
|
|
<option value="properties">Properties</option>
|
|
|
|
<option value="//api/name/cropEnabled"> cropEnabled</option>
|
|
|
|
<option value="//api/name/cropRect"> cropRect</option>
|
|
|
|
<option value="//api/name/image"> image</option>
|
|
|
|
<option value="//api/name/imageModificationBlock"> imageModificationBlock</option>
|
|
|
|
<option value="//api/name/tint"> tint</option>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<option value="instance_methods">Instance Methods</option>
|
|
|
|
<option value="//api/name/setCropEnabled:recropImmediately:inBounds:"> - setCropEnabled:recropImmediately:inBounds:</option>
|
|
|
|
<option value="//api/name/setNeedsDisplayWithCompletion:"> - setNeedsDisplayWithCompletion:</option>
|
|
|
|
|
|
|
|
</select>
|
|
</li>
|
|
</ul>
|
|
</header>
|
|
<nav id="tocContainer" class="isShowingTOC">
|
|
<ul id="toc" role="tree">
|
|
|
|
<li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li>
|
|
|
|
|
|
|
|
|
|
<li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
|
|
|
|
</ul></li>
|
|
|
|
|
|
|
|
|
|
|
|
<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#properties">Properties</a></span><ul>
|
|
|
|
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/cropEnabled">cropEnabled</a></span></li>
|
|
|
|
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/cropRect">cropRect</a></span></li>
|
|
|
|
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/image">image</a></span></li>
|
|
|
|
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/imageModificationBlock">imageModificationBlock</a></span></li>
|
|
|
|
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/tint">tint</a></span></li>
|
|
|
|
</ul></li>
|
|
|
|
|
|
|
|
|
|
|
|
<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul>
|
|
|
|
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setCropEnabled:recropImmediately:inBounds:">setCropEnabled:recropImmediately:inBounds:</a></span></li>
|
|
|
|
<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/setNeedsDisplayWithCompletion:">setNeedsDisplayWithCompletion:</a></span></li>
|
|
|
|
</ul></li>
|
|
|
|
|
|
</ul>
|
|
</nav>
|
|
<article>
|
|
<div id="contents" class="isShowingTOC" role="main">
|
|
<a title="ASImageNode Class Reference" name="top"></a>
|
|
<div class="main-navigation navigation-top">
|
|
<ul>
|
|
<li><a href="../index.html">Index</a></li>
|
|
<li><a href="../hierarchy.html">Hierarchy</a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="header">
|
|
<div class="section-header">
|
|
<h1 class="title title-header">ASImageNode Class Reference</h1>
|
|
</div>
|
|
</div>
|
|
<div id="container">
|
|
|
|
<div class="section section-specification"><table cellspacing="0"><tbody>
|
|
<tr>
|
|
<td class="specification-title">Inherits from</td>
|
|
<td class="specification-value"><a href="../Classes/ASControlNode.html">ASControlNode</a> : <a href="../Classes/ASDisplayNode.html">ASDisplayNode</a> : ASDealloc2MainObject</td>
|
|
</tr><tr>
|
|
<td class="specification-title">Declared in</td>
|
|
<td class="specification-value">ASImageNode.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>Supports cropping, tinting, and arbitrary image modification blocks.</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="section section-tasks">
|
|
<a title="Tasks" name="tasks"></a>
|
|
<h2 class="subtitle subtitle-tasks">Tasks</h2>
|
|
|
|
|
|
|
|
|
|
|
|
<ul class="task-list">
|
|
<li>
|
|
<span class="tooltip">
|
|
<code><a href="#//api/name/image"> image</a></code>
|
|
</span>
|
|
<span class="task-item-suffix">property</span>
|
|
|
|
</li><li>
|
|
<span class="tooltip">
|
|
<code><a href="#//api/name/tint"> tint</a></code>
|
|
</span>
|
|
<span class="task-item-suffix">property</span>
|
|
|
|
</li><li>
|
|
<span class="tooltip">
|
|
<code><a href="#//api/name/cropEnabled"> cropEnabled</a></code>
|
|
</span>
|
|
<span class="task-item-suffix">property</span>
|
|
|
|
</li><li>
|
|
<span class="tooltip">
|
|
<code><a href="#//api/name/setCropEnabled:recropImmediately:inBounds:">– setCropEnabled:recropImmediately:inBounds:</a></code>
|
|
</span>
|
|
|
|
|
|
</li><li>
|
|
<span class="tooltip">
|
|
<code><a href="#//api/name/cropRect"> cropRect</a></code>
|
|
</span>
|
|
<span class="task-item-suffix">property</span>
|
|
|
|
</li><li>
|
|
<span class="tooltip">
|
|
<code><a href="#//api/name/imageModificationBlock"> imageModificationBlock</a></code>
|
|
</span>
|
|
<span class="task-item-suffix">property</span>
|
|
|
|
</li><li>
|
|
<span class="tooltip">
|
|
<code><a href="#//api/name/setNeedsDisplayWithCompletion:">– setNeedsDisplayWithCompletion:</a></code>
|
|
</span>
|
|
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="section section-methods">
|
|
<a title="Properties" name="properties"></a>
|
|
<h2 class="subtitle subtitle-methods">Properties</h2>
|
|
|
|
<div class="section-method">
|
|
<a name="//api/name/cropEnabled" title="cropEnabled"></a>
|
|
<h3 class="subsubtitle method-title">cropEnabled</h3>
|
|
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>Indicates whether efficient cropping of the receiver is enabled.</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>@property (nonatomic, assign, getter=isCropEnabled) BOOL cropEnabled</code></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection discussion-section">
|
|
<h4 class="method-subtitle">Discussion</h4>
|
|
<p>Defaults to YES. See -setCropEnabled:recropImmediately:inBounds: for more
|
|
information.</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<code class="declared-in-ref">ASImageNode.h</code><br />
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="section-method">
|
|
<a name="//api/name/cropRect" title="cropRect"></a>
|
|
<h3 class="subsubtitle method-title">cropRect</h3>
|
|
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>A value that controls how the receiver’s efficient cropping is aligned.</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite, assign) CGRect cropRect</code></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection discussion-section">
|
|
<h4 class="method-subtitle">Discussion</h4>
|
|
<p>This value defines a rectangle that is to be featured by the
|
|
receiver. The rectangle is specified as a “unit rectangle,” using
|
|
percentages of the source image’s width and height, e.g. CGRectMake(0.5, 0,
|
|
0.5, 1.0) will feature the full right half a photo. If the cropRect is
|
|
empty, the content mode of the receiver will be used to determine its
|
|
dimensions, and only the cropRect’s origin will be used for positioning. The
|
|
default value of this property is CGRectMake(0.5, 0.5, 0.0, 0.0).</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<code class="declared-in-ref">ASImageNode.h</code><br />
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="section-method">
|
|
<a name="//api/name/image" title="image"></a>
|
|
<h3 class="subsubtitle method-title">image</h3>
|
|
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>The image to display.</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>@property (atomic, retain) UIImage *image</code></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection discussion-section">
|
|
<h4 class="method-subtitle">Discussion</h4>
|
|
<p>The node will efficiently display stretchable images by using
|
|
the layer’s contentsCenter property. Non-stretchable images work too, of
|
|
course.</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<code class="declared-in-ref">ASImageNode.h</code><br />
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="section-method">
|
|
<a name="//api/name/imageModificationBlock" title="imageModificationBlock"></a>
|
|
<h3 class="subsubtitle method-title">imageModificationBlock</h3>
|
|
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>An optional block which can perform drawing operations on image
|
|
during the display phase.</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>@property (nonatomic, readwrite, copy) asimagenode_modification_block_t imageModificationBlock</code></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection discussion-section">
|
|
<h4 class="method-subtitle">Discussion</h4>
|
|
<p>Can be used to add image effects (such as rounding, adding
|
|
borders, or other pattern overlays) without extraneous display calls.</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<code class="declared-in-ref">ASImageNode.h</code><br />
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="section-method">
|
|
<a name="//api/name/tint" title="tint"></a>
|
|
<h3 class="subsubtitle method-title">tint</h3>
|
|
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>Simple way to tint the image.</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>@property (nonatomic, assign) ASImageNodeTint tint</code></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<code class="declared-in-ref">ASImageNode.h</code><br />
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="section section-methods">
|
|
<a title="Instance Methods" name="instance_methods"></a>
|
|
<h2 class="subtitle subtitle-methods">Instance Methods</h2>
|
|
|
|
<div class="section-method">
|
|
<a name="//api/name/setCropEnabled:recropImmediately:inBounds:" title="setCropEnabled:recropImmediately:inBounds:"></a>
|
|
<h3 class="subsubtitle method-title">setCropEnabled:recropImmediately:inBounds:</h3>
|
|
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>Enables or disables efficient cropping.</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>- (void)setCropEnabled:(id)<em>cropEnabled</em> recropImmediately:(id)<em>recropImmediately</em> inBounds:(id)<em>cropBounds</em></code></div>
|
|
|
|
|
|
|
|
<div class="method-subsection arguments-section parameters">
|
|
<h4 class="method-subtitle parameter-title">Parameters</h4>
|
|
|
|
<dl class="argument-def parameter-def">
|
|
<dt><em>cropEnabled</em></dt>
|
|
<dd><p>YES to efficiently crop the receiver’s contents such that
|
|
contents outside of its bounds are not included; NO otherwise.</p></dd>
|
|
</dl>
|
|
|
|
<dl class="argument-def parameter-def">
|
|
<dt><em>recropImmediately</em></dt>
|
|
<dd><p>If the receiver has an image, YES to redisplay the
|
|
receiver immediately; NO otherwise.</p></dd>
|
|
</dl>
|
|
|
|
<dl class="argument-def parameter-def">
|
|
<dt><em>cropBounds</em></dt>
|
|
<dd><p>The bounds into which the receiver will be cropped. Useful
|
|
if bounds are to change in response to cropping (but have not yet done so).</p></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection discussion-section">
|
|
<h4 class="method-subtitle">Discussion</h4>
|
|
<p>Efficient cropping is only performed when the receiver’s view’s
|
|
contentMode is UIViewContentModeScaleAspectFill. By default, cropping is
|
|
enabled. The crop alignment may be controlled via cropAlignmentFactor.</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<code class="declared-in-ref">ASImageNode.h</code><br />
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="section-method">
|
|
<a name="//api/name/setNeedsDisplayWithCompletion:" title="setNeedsDisplayWithCompletion:"></a>
|
|
<h3 class="subsubtitle method-title">setNeedsDisplayWithCompletion:</h3>
|
|
|
|
|
|
|
|
<div class="method-subsection brief-description">
|
|
<p>Marks the receiver as needing display and performs a block after
|
|
display has finished.</p>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="method-subsection method-declaration"><code>- (void)setNeedsDisplayWithCompletion:(id)<em>displayCompletionBlock</em></code></div>
|
|
|
|
|
|
|
|
<div class="method-subsection arguments-section parameters">
|
|
<h4 class="method-subtitle parameter-title">Parameters</h4>
|
|
|
|
<dl class="argument-def parameter-def">
|
|
<dt><em>displayCompletionBlock</em></dt>
|
|
<dd><p>The block to be performed after display has
|
|
finished. Its <code>canceled</code> property will be YES if display was prevented or
|
|
canceled (via preventOrCancelDisplay); NO otherwise.</p></dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection discussion-section">
|
|
<h4 class="method-subtitle">Discussion</h4>
|
|
<p>displayCompletionBlock will be performed on the main-thread. If
|
|
<code>preventOrCancelDisplay</code> is YES, <code>displayCompletionBlock</code> is will be
|
|
performed immediately and <code>YES</code> will be passed for <code>canceled</code>.</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="method-subsection declared-in-section">
|
|
<h4 class="method-subtitle">Declared In</h4>
|
|
<code class="declared-in-ref">ASImageNode.h</code><br />
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
<div class="main-navigation navigation-bottom">
|
|
<ul>
|
|
<li><a href="../index.html">Index</a></li>
|
|
<li><a href="../hierarchy.html">Hierarchy</a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="footer">
|
|
<hr />
|
|
<div class="footer-copyright">
|
|
<p><span class="copyright">© 2014 Facebook. All rights reserved. (Last updated: 2014-10-17)</span><br />
|
|
|
|
<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 963)</a>.</span></p>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
<script type="text/javascript">
|
|
function jumpToChange()
|
|
{
|
|
window.location.hash = this.options[this.selectedIndex].value;
|
|
}
|
|
|
|
function toggleTOC()
|
|
{
|
|
var contents = document.getElementById('contents');
|
|
var tocContainer = document.getElementById('tocContainer');
|
|
|
|
if (this.getAttribute('class') == 'open')
|
|
{
|
|
this.setAttribute('class', '');
|
|
contents.setAttribute('class', '');
|
|
tocContainer.setAttribute('class', '');
|
|
|
|
window.name = "hideTOC";
|
|
}
|
|
else
|
|
{
|
|
this.setAttribute('class', 'open');
|
|
contents.setAttribute('class', 'isShowingTOC');
|
|
tocContainer.setAttribute('class', 'isShowingTOC');
|
|
|
|
window.name = "";
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function toggleTOCEntryChildren(e)
|
|
{
|
|
e.stopPropagation();
|
|
var currentClass = this.getAttribute('class');
|
|
if (currentClass == 'children') {
|
|
this.setAttribute('class', 'children open');
|
|
}
|
|
else if (currentClass == 'children open') {
|
|
this.setAttribute('class', 'children');
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function tocEntryClick(e)
|
|
{
|
|
e.stopPropagation();
|
|
return true;
|
|
}
|
|
|
|
function init()
|
|
{
|
|
var selectElement = document.getElementById('jumpTo');
|
|
selectElement.addEventListener('change', jumpToChange, false);
|
|
|
|
var tocButton = document.getElementById('table_of_contents');
|
|
tocButton.addEventListener('click', toggleTOC, false);
|
|
|
|
var taskTreeItem = document.getElementById('task_treeitem');
|
|
if (taskTreeItem.getElementsByTagName('li').length > 0)
|
|
{
|
|
taskTreeItem.setAttribute('class', 'children');
|
|
taskTreeItem.firstChild.setAttribute('class', 'disclosure');
|
|
}
|
|
|
|
var tocList = document.getElementById('toc');
|
|
|
|
var tocEntries = tocList.getElementsByTagName('li');
|
|
for (var i = 0; i < tocEntries.length; i++) {
|
|
tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
|
|
}
|
|
|
|
var tocLinks = tocList.getElementsByTagName('a');
|
|
for (var i = 0; i < tocLinks.length; i++) {
|
|
tocLinks[i].addEventListener('click', tocEntryClick, false);
|
|
}
|
|
|
|
if (window.name == "hideTOC") {
|
|
toggleTOC.call(tocButton);
|
|
}
|
|
}
|
|
|
|
window.onload = init;
|
|
|
|
// If showing in Xcode, hide the TOC and Header
|
|
if (navigator.userAgent.match(/xcode/i)) {
|
|
document.getElementById("contents").className = "hideInXcode"
|
|
document.getElementById("tocContainer").className = "hideInXcode"
|
|
document.getElementById("top_header").className = "hideInXcode"
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
</html> |