mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
update website
This commit is contained in:
@@ -48,7 +48,6 @@ A common use case is to set the backgroundColor for every page</p></div></div><d
|
||||
<span class="token keyword">var</span> createExamplePage <span class="token operator">=</span> <span class="token function">require<span class="token punctuation">(</span></span><span class="token string">'./createExamplePage'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">var</span> <span class="token punctuation">{</span>
|
||||
AlertIOS<span class="token punctuation">,</span>
|
||||
PixelRatio<span class="token punctuation">,</span>
|
||||
ScrollView<span class="token punctuation">,</span>
|
||||
StyleSheet<span class="token punctuation">,</span>
|
||||
Text<span class="token punctuation">,</span>
|
||||
@@ -255,7 +254,7 @@ A common use case is to set the backgroundColor for every page</p></div></div><d
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
line<span class="token punctuation">:</span> <span class="token punctuation">{</span>
|
||||
backgroundColor<span class="token punctuation">:</span> <span class="token string">'#bbbbbb'</span><span class="token punctuation">,</span>
|
||||
height<span class="token punctuation">:</span> <span class="token number">1</span> <span class="token operator">/</span> PixelRatio<span class="token punctuation">.</span><span class="token keyword">get</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
|
||||
height<span class="token punctuation">:</span> StyleSheet<span class="token punctuation">.</span>hairlineWidth<span class="token punctuation">,</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
row<span class="token punctuation">:</span> <span class="token punctuation">{</span>
|
||||
backgroundColor<span class="token punctuation">:</span> <span class="token string">'white'</span><span class="token punctuation">,</span>
|
||||
@@ -264,7 +263,7 @@ A common use case is to set the backgroundColor for every page</p></div></div><d
|
||||
paddingVertical<span class="token punctuation">:</span> <span class="token number">15</span><span class="token punctuation">,</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
separator<span class="token punctuation">:</span> <span class="token punctuation">{</span>
|
||||
height<span class="token punctuation">:</span> <span class="token number">1</span> <span class="token operator">/</span> PixelRatio<span class="token punctuation">.</span><span class="token keyword">get</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
|
||||
height<span class="token punctuation">:</span> StyleSheet<span class="token punctuation">.</span>hairlineWidth<span class="token punctuation">,</span>
|
||||
backgroundColor<span class="token punctuation">:</span> <span class="token string">'#bbbbbb'</span><span class="token punctuation">,</span>
|
||||
marginLeft<span class="token punctuation">:</span> <span class="token number">15</span><span class="token punctuation">,</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
|
||||
File diff suppressed because one or more lines are too long
+10
-1
@@ -17,7 +17,16 @@
|
||||
easier to understand.</li><li>Naming the styles is a good way to add meaning to the low level components
|
||||
in the render function.</li></ul><p>Performance:</p><ul><li>Making a stylesheet from a style object makes it possible to refer to it
|
||||
by ID instead of creating a new style object every time.</li><li>It also allows to send the style only once through the bridge. All
|
||||
subsequent uses are going to refer an id (not implemented yet).</li></ul></div><span><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="#methods">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="create"></a><span class="propType">static </span>create<span class="propType">(obj: {[key: string]: any})</span> <a class="hash-link" href="#create">#</a></h4></div></div></span></div><div class="docs-prevnext"><a class="docs-next" href="toastandroid.html#content">Next →</a></div></div><noscript></noscript></section><footer class="wrap"><div class="center">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
|
||||
subsequent uses are going to refer an id (not implemented yet).</li></ul></div><span><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="#methods">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="create"></a><span class="propType">static </span>create<span class="propType">(obj: {[key: string]: any})</span> <a class="hash-link" href="#create">#</a></h4><div><p>Creates a StyleSheet style reference from the given object.</p></div></div></div></span><span><h3><a class="anchor" name="properties"></a>Properties <a class="hash-link" href="#properties">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="hairlinewidth"></a>hairlineWidth<span class="propType">: CallExpression</span> <a class="hash-link" href="#hairlinewidth">#</a></h4><div><p>This is defined as the width of a thin line on the platform. It can be
|
||||
used as the thickness of a border or division between two elements.
|
||||
Example:</p><div class="prism language-javascript"> <span class="token punctuation">{</span>
|
||||
borderBottomColor<span class="token punctuation">:</span> <span class="token string">'#bbb'</span><span class="token punctuation">,</span>
|
||||
borderBottomWidth<span class="token punctuation">:</span> StyleSheet<span class="token punctuation">.</span>hairlineWidth
|
||||
<span class="token punctuation">}</span></div><p>This constant will always be a round number of pixels (so a line defined
|
||||
by it look crisp) and will try to match the standard width of a thin line
|
||||
on the underlying platform. However, you should not rely on it being a
|
||||
constant size, because on different platforms and screen densities its
|
||||
value may be calculated differently.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="flatten"></a>flatten<span class="propType">: CallExpression</span> <a class="hash-link" href="#flatten">#</a></h4></div></div></span></div><div class="docs-prevnext"><a class="docs-next" href="toastandroid.html#content">Next →</a></div></div><noscript></noscript></section><footer class="wrap"><div class="center">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
|
||||
Reference in New Issue
Block a user