Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. import React from 'react';
  2. import { ScrollView, Text, StyleSheet, View, TextInput } from 'react-native';
  3.  
  4.  
  5.  
  6. export default class App extends React.Component {
  7.  
  8. render() {
  9. return (
  10. <View>
  11.  
  12. <TextInput
  13. style={styles.input}
  14. placeholder="Feed Me"
  15. onChangeText={(text) => this.setState({text})}
  16. />
  17.  
  18. <View style={styles.background}>
  19.  
  20. <ScrollView >
  21. {this.props.text.map((item)=>
  22. <Text style={styles.font}>{item}</Text>
  23. )}
  24. </ScrollView>
  25. </View>
  26. </View>
  27. );
  28. }
  29. }
  30.  
  31. const styles = StyleSheet.create({
  32. background:{
  33. alignItems: 'center'
  34. },
  35. font:{
  36. fontSize: 30,
  37. },
  38. input:{
  39. height: 40, marginTop:30, borderColor: 'gray', borderWidth: 1, textAlign: 'center'
  40. }
  41. })
  42.  
  43.  
  44.  
  45. App.defaultProps = {
  46. text: ['Burger King', 'McDonalds', 'Red Lobster',
  47. 'Dennys', 'Wendys', 'White Castle', 'popeyes']
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement