daily pastebin goal
41%
SHARE
TWEET

ImagenExterna.js

a guest Jan 29th, 2018 39 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.   StyleSheet,
  10.   Text,
  11.   View,
  12.   Dimensions,
  13.   Image
  14. } from 'react-native';
  15.  
  16.  
  17. export default class ImagenExterna extends Component<{}> {
  18.  
  19.   constructor(props, env){
  20.     super(props, env);
  21.  
  22.     console.log(this.props);
  23.  
  24.     let urlImagen = "https://orlandofamilyphysicians.com/wp-content/uploads/2016/12/placeholder-600x400.png";
  25.     if(this.props.urlImagen != undefined){
  26.       urlImagen = this.props.urlImagen;
  27.     }
  28.  
  29.     let texto = "< - Texto No Introducido!! - >";
  30.     if(this.props.texto != undefined){
  31.       texto = this.props.texto;
  32.     }
  33.  
  34.     this.state = {
  35.       colorFondo: 'white',
  36.       urlImagen: urlImagen,
  37.       texto: texto
  38.     }
  39.   }
  40.  
  41.   render() {
  42.     return (
  43.       <View>
  44.         <Image
  45.           style={{width: 200, height: 200, alignItems: "center"}}
  46.           source={{uri: this.state.urlImagen}}>
  47.         </Image>
  48.         <Text>
  49.           {this.state.texto}
  50.         </Text>
  51.       </View>
  52.     );
  53.   }
  54. }
  55.  
  56. const styles = StyleSheet.create({
  57.  
  58. });
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top