Advertisement
zidniryi

TextArea KonsepKoding

Mar 4th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. <!-- HTML generated using hilite.me --><div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><table><tr><td><pre style="margin: 0; line-height: 125%"> 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30</pre></td><td><pre style="margin: 0; line-height: 125%"><span style="color: #008800; font-weight: bold">import</span> <span style="color: #0e84b5; font-weight: bold">React</span><span style="color: #333333">,</span> { Component } <span style="color: #008800; font-weight: bold">from</span> <span style="background-color: #fff0f0">&#39;react&#39;</span>;
  31. <span style="color: #008800; font-weight: bold">import</span> { View, Text, TextInput } <span style="color: #008800; font-weight: bold">from</span> <span style="background-color: #fff0f0">&#39;react-native&#39;</span>;
  32.  
  33. export default <span style="color: #008800; font-weight: bold">class</span> <span style="color: #BB0066; font-weight: bold">App</span> extends Component {
  34. constructor(props) {
  35. <span style="color: #007020">super</span>(props);
  36. this<span style="color: #333333">.</span>state <span style="color: #333333">=</span> {
  37. text:<span style="background-color: #fff0f0">&#39;&#39;</span>
  38. };
  39. }
  40.  
  41. render() {
  42. <span style="color: #008800; font-weight: bold">return</span> (
  43. <span style="color: #333333">&lt;</span>View <span style="color: #333333">&gt;</span>
  44. <span style="color: #333333">&lt;</span>Text style<span style="color: #333333">=</span>{{marginLeft:<span style="color: #0000DD; font-weight: bold">5</span>}}<span style="color: #333333">&gt;</span> Comment: <span style="color: #333333">&lt;/</span>Text<span style="color: #333333">&gt;</span>
  45. <span style="color: #333333">&lt;</span>TextInput
  46. multiline<span style="color: #333333">=</span>{true}
  47. numberOfLines<span style="color: #333333">=</span>{<span style="color: #0000DD; font-weight: bold">4</span>}
  48. onChangeText<span style="color: #333333">=</span>{text <span style="color: #333333">=&gt;</span> this<span style="color: #333333">.</span>setState({ text })}
  49. value<span style="color: #333333">=</span>{this<span style="color: #333333">.</span>state<span style="color: #333333">.</span>text}
  50. style<span style="color: #333333">=</span>{{
  51. borderWidth:<span style="color: #0000DD; font-weight: bold">1</span>,
  52. marginHorizontal:<span style="color: #0000DD; font-weight: bold">10</span>,
  53. borderRadius:<span style="color: #0000DD; font-weight: bold">5</span>
  54. }}
  55. <span style="color: #333333">/&gt;</span>
  56. <span style="color: #333333">&lt;/</span>View<span style="color: #333333">&gt;</span>
  57. );
  58. }
  59. }
  60. </pre></td></tr></table></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement