React native image view

import React, { Component } from 'react'; import { StyleSheet, ScrollView, TextInput, Image, View, } from 'react-native'; export class DisplayImageView extends Component { render() { var imgSource = {uri: this.props.imageUri}; var imageView = (<Image style={styles.image} source={imgSource} rezieMode="contain" />); return (<View style={styles.wrapper}> {imageView} </View>); } } const styles = StyleSheet.create({ wrapper: { flex: 1, alignItems: "stretch", }, image: { flex: 1, } });
image display JSX

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.