mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Updated docs for next
This commit is contained in:
@@ -279,7 +279,7 @@ class <span class="token class-name">FlatListExample</span> extends <span class=
|
||||
<span class="token keyword">this</span><span class="token punctuation">.</span>_listRef<span class="token punctuation">.</span><span class="token function">getNode<span class="token punctuation">(</span></span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">recordInteraction<span class="token punctuation">(</span></span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
<span class="token function">pressItem<span class="token punctuation">(</span></span><span class="token keyword">this</span><span class="token punctuation">,</span> key<span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">;</span>
|
||||
_listRef<span class="token punctuation">:</span> FlatList<<span class="token operator">*</span><span class="token operator">></span><span class="token punctuation">;</span>
|
||||
_listRef<span class="token punctuation">:</span> AnimatedFlatList<span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span>
|
||||
|
||||
|
||||
|
||||
@@ -103,14 +103,14 @@ should be either a local file path or the name of a static image resource
|
||||
these will be used to set the default <code><Image/></code> component dimensions.</li><li><code>scale</code> - used to indicate the scale factor of the image. Defaults to 1.0 if
|
||||
unspecified, meaning that one image pixel equates to one display point / DIP.</li><li><code>number</code> - Opaque type returned by something like <code>require('./image.jpg')</code>.</li></ul></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onpartialload"></a><span class="platform">ios</span>onPartialLoad?: <span class="propType">function</span> <a class="hash-link" href="docs/image.html#onpartialload">#</a></h4><div><p>Invoked when a partial load of the image is complete. The definition of
|
||||
what constitutes a "partial load" is loader specific though this is meant
|
||||
for progressive JPEG loads.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onprogress"></a><span class="platform">ios</span>onProgress?: <span class="propType">function</span> <a class="hash-link" href="docs/image.html#onprogress">#</a></h4><div><p>Invoked on download progress with <code>{nativeEvent: {loaded, total}}</code>.</p></div></div></div><span><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="docs/image.html#methods">#</a></h3><div class="props"><div class="prop"><h4 class="methodTitle"><a class="anchor" name="getsize"></a><span class="methodType">static </span>getSize<span class="methodType">(uri: string, success: function, failure: function): </span> <a class="hash-link" href="docs/image.html#getsize">#</a></h4><div><p>Retrieve the width and height (in pixels) of an image prior to displaying it.
|
||||
for progressive JPEG loads.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onprogress"></a><span class="platform">ios</span>onProgress?: <span class="propType">function</span> <a class="hash-link" href="docs/image.html#onprogress">#</a></h4><div><p>Invoked on download progress with <code>{nativeEvent: {loaded, total}}</code>.</p></div></div></div><span><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="docs/image.html#methods">#</a></h3><div class="props"><div class="prop"><h4 class="methodTitle"><a class="anchor" name="getsize"></a><span class="methodType">static </span>getSize<span class="methodType">(uri: string, success: function, failure?: function): </span> <a class="hash-link" href="docs/image.html#getsize">#</a></h4><div><p>Retrieve the width and height (in pixels) of an image prior to displaying it.
|
||||
This method can fail if the image cannot be found, or fails to download.</p><p>In order to retrieve the image dimensions, the image may first need to be
|
||||
loaded or downloaded, after which it will be cached. This means that in
|
||||
principle you could use this method to preload images, however it is not
|
||||
optimized for that purpose, and may in future be implemented in a way that
|
||||
does not fully load/download the image data. A proper, supported way to
|
||||
preload images will be provided as a separate API.</p><p>Does not work for static image resources.</p></div><div><strong>Parameters:</strong><table class="params"><thead><tr><th>Name and Type</th><th>Description</th></tr></thead><tbody><tr><td>uri<br><br><div><span>string</span></div></td><td class="description"><div><p>The location of the image.</p></div></td></tr><tr><td>success<br><br><div><span>function</span></div></td><td class="description"><div><p>The function that will be called if the image was successfully found and width
|
||||
and height retrieved.</p></div></td></tr><tr><td>failure<br><br><div><span>function</span></div></td><td class="description"><div><p>The function that will be called if there was an error, such as failing to
|
||||
and height retrieved.</p></div></td></tr><tr><td>[failure]<br><br><div><span>function</span></div></td><td class="description"><div><p>The function that will be called if there was an error, such as failing to
|
||||
to retrieve the image.</p></div></td></tr></tbody></table></div></div><div class="prop"><h4 class="methodTitle"><a class="anchor" name="prefetch"></a><span class="methodType">static </span>prefetch<span class="methodType">(url: string): </span> <a class="hash-link" href="docs/image.html#prefetch">#</a></h4><div><p>Prefetches a remote image for later use by downloading it to the disk
|
||||
cache</p></div><div><strong>Parameters:</strong><table class="params"><thead><tr><th>Name and Type</th><th>Description</th></tr></thead><tbody><tr><td>url<br><br><div><span>string</span></div></td><td class="description"><div><p>The remote location of the image.</p></div></td></tr></tbody></table></div></div></div></span></div><p class="edit-page-block">You can <a target="_blank" href="https://github.com/facebook/react-native/blob/master/Libraries/Image/Image.ios.js">edit the content above on GitHub</a> and send us a pull request!</p><div><div><table width="100%"><tbody><tr><td><h3><a class="anchor" name="examples"></a>Examples <a class="hash-link" href="docs/image.html#examples">#</a></h3></td><td style="text-align:right;"><a target="_blank" href="https://github.com/facebook/react-native/blob/master/Examples/UIExplorer/js/ImageExample.js">Edit on GitHub</a></td></tr></tbody></table><div class="example-container"><div class="prism language-javascript"><span class="token string">'use strict'</span><span class="token punctuation">;</span>
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ exports<span class="token punctuation">.</span>examples <span class="token opera
|
||||
description<span class="token punctuation">:</span> <span class="token string">'You can display <ScrollView>\'s child components horizontally rather than vertically'</span><span class="token punctuation">,</span>
|
||||
render<span class="token punctuation">:</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
|
||||
<span class="token keyword">function</span> <span class="token function">renderScrollView<span class="token punctuation">(</span></span>title<span class="token punctuation">:</span> string<span class="token punctuation">,</span> addtionalStyles<span class="token punctuation">:</span> StyleSheet<span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">function</span> <span class="token function">renderScrollView<span class="token punctuation">(</span></span>title<span class="token punctuation">:</span> string<span class="token punctuation">,</span> addtionalStyles<span class="token punctuation">:</span> <span class="token keyword">typeof</span> StyleSheet<span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">var</span> _scrollView<span class="token punctuation">:</span> ScrollView<span class="token punctuation">;</span>
|
||||
<span class="token keyword">return</span> <span class="token punctuation">(</span>
|
||||
<View style<span class="token operator">=</span><span class="token punctuation">{</span>addtionalStyles<span class="token punctuation">}</span><span class="token operator">></span>
|
||||
|
||||
Reference in New Issue
Block a user