SHARE
TWEET
ImagenExterna.js
a guest
Jan 29th, 2018
39
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 {
- StyleSheet,
- Text,
- View,
- Dimensions,
- Image
- } from 'react-native';
- export default class ImagenExterna extends Component<{}> {
- constructor(props, env){
- super(props, env);
- console.log(this.props);
- let urlImagen = "https://orlandofamilyphysicians.com/wp-content/uploads/2016/12/placeholder-600x400.png";
- if(this.props.urlImagen != undefined){
- urlImagen = this.props.urlImagen;
- }
- let texto = "< - Texto No Introducido!! - >";
- if(this.props.texto != undefined){
- texto = this.props.texto;
- }
- this.state = {
- colorFondo: 'white',
- urlImagen: urlImagen,
- texto: texto
- }
- }
- render() {
- return (
- <View>
- <Image
- style={{width: 200, height: 200, alignItems: "center"}}
- source={{uri: this.state.urlImagen}}>
- </Image>
- <Text>
- {this.state.texto}
- </Text>
- </View>
- );
- }
- }
- const styles = StyleSheet.create({
- });
RAW Paste Data

