SHARE
TWEET
App.js
a guest
Jan 29th, 2018
52
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- /**
- * Sample React Native App
- * https://github.com/facebook/react-native
- * @flow
- */
- import React, { Component } from 'react';
- import {
- Platform,
- StyleSheet,
- Text,
- View,
- TouchableOpacity,
- TextInput,
- Dimensions,
- Image,
- ScrollView,
- WebView
- } from 'react-native';
- import { Pages } from 'react-native-pages';
- import ImagenExterna from "./ImagenExterna"
- export default class App extends Component<{}> {
- constructor(props, env){
- super(props, env);
- this.state = {
- colorFondo: 'yellow',
- direccion: 'https://google.com'
- }
- }
- cambiarColor(){
- this.setState({colorFondo: this.state.text})
- }
- cambiarPagina(){
- this.setState({direccion: this.state.text})
- }
- render() {
- return (
- <Pages>
- <View style={styles.container}>
- <Text style={styles.welcome}>Hola esto es un texto</Text>
- </View>
- <View style={styles.container}>
- <ImagenExterna texto="Hola" urlImagen="https://massolutions.biz/wp-content/uploads/2014/12/e5a06942fa42823c88be5f3a834e063d-fantastic-art-bat-family.jpg"/>
- </View>
- <View style={{ flex: 1, backgroundColor: 'blue' }} />
- </Pages>
- );
- }
- }
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
- backgroundColor: 'yellow',
- },
- welcome: {
- fontSize: 20,
- textAlign: 'center',
- margin: 10,
- },
- instructions: {
- textAlign: 'center',
- color: '#333333',
- marginBottom: 5,
- },
- boton: {
- backgroundColor: 'red',
- width: 300,
- height: 50,
- borderWidth: 2,
- borderColor: 'white',
- borderRadius: 15,
- alignItems: 'center',
- flexDirection: 'row'
- },
- botonVerde: {
- backgroundColor: 'green',
- width: 300,
- height: 50,
- borderWidth: 2,
- borderColor: 'white',
- borderRadius: 15,
- alignItems: 'center',
- flexDirection: 'row'
- },
- textoBoton:{
- color: 'white',
- fontSize: 20,
- textAlign: 'center',
- flex: 1
- }
- });
RAW Paste Data

