daily pastebin goal
41%
SHARE
TWEET

App.js

a guest Jan 29th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Sample React Native App
  3.  * https://github.com/facebook/react-native
  4.  * @flow
  5.  */
  6.  
  7. import React, { Component } from 'react';
  8. import {
  9.   Platform,
  10.   StyleSheet,
  11.   Text,
  12.   View,
  13.   TouchableOpacity,
  14.   TextInput,
  15.   Dimensions,
  16.   Image,
  17.   ScrollView,
  18.   WebView
  19. } from 'react-native';
  20.  
  21. import { Pages } from 'react-native-pages';
  22.  
  23. import ImagenExterna from "./ImagenExterna"
  24.  
  25. export default class App extends Component<{}> {
  26.  
  27.   constructor(props, env){
  28.     super(props, env);
  29.  
  30.     this.state = {
  31.       colorFondo: 'yellow',
  32.       direccion: 'https://google.com'
  33.     }
  34.   }
  35.  
  36.   cambiarColor(){
  37.  
  38.     this.setState({colorFondo: this.state.text})
  39.  
  40.  
  41.   }
  42.  
  43.   cambiarPagina(){
  44.     this.setState({direccion: this.state.text})
  45.   }
  46.  
  47.   render() {
  48.     return (
  49.       <Pages>
  50.         <View style={styles.container}>
  51.           <Text style={styles.welcome}>Hola esto es un texto</Text>
  52.         </View>
  53.         <View style={styles.container}>
  54.           <ImagenExterna texto="Hola" urlImagen="https://massolutions.biz/wp-content/uploads/2014/12/e5a06942fa42823c88be5f3a834e063d-fantastic-art-bat-family.jpg"/>
  55.         </View>
  56.         <View style={{ flex: 1, backgroundColor: 'blue' }} />
  57.       </Pages>
  58.     );
  59.   }
  60. }
  61.  
  62. const styles = StyleSheet.create({
  63.   container: {
  64.     flex: 1,
  65.     justifyContent: 'center',
  66.     alignItems: 'center',
  67.     backgroundColor: 'yellow',
  68.   },
  69.   welcome: {
  70.     fontSize: 20,
  71.     textAlign: 'center',
  72.     margin: 10,
  73.   },
  74.   instructions: {
  75.     textAlign: 'center',
  76.     color: '#333333',
  77.     marginBottom: 5,
  78.   },
  79.   boton: {
  80.     backgroundColor: 'red',
  81.     width: 300,
  82.     height: 50,
  83.     borderWidth: 2,
  84.     borderColor: 'white',
  85.     borderRadius: 15,
  86.     alignItems: 'center',
  87.     flexDirection: 'row'
  88.   },
  89.   botonVerde: {
  90.     backgroundColor: 'green',
  91.     width: 300,
  92.     height: 50,
  93.     borderWidth: 2,
  94.     borderColor: 'white',
  95.     borderRadius: 15,
  96.     alignItems: 'center',
  97.     flexDirection: 'row'
  98.   },
  99.   textoBoton:{
  100.     color: 'white',
  101.     fontSize: 20,
  102.     textAlign: 'center',
  103.     flex: 1
  104.   }
  105. });
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top