How to add caption to a image in React Native

react-native

Solution

Check the below sample.

import React, {Component} from 'react';
import {AppRegistry, Text, Image, View} from 'react-native';

class StackOveflow extends Component {
  render() {
    return (
      <View style={{flex:1,alignItems:'center',justifyContent:'center'}}>
        <Image
          style={{width:200,height:200}}
          source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}}
        />
        <Text> Hello world! </Text>
      </View>
    );
  }
}

AppRegistry.registerComponent('StackOveflow', () => StackOveflow);

Let me know if this works for you.

Problem

``` <Image style={styles.Img} source={require('./Images/x.png')}> </Image> Img:{ width:200,height:200,resizeMode: 'contain' } ``` I am learning React Native. Not Sure how to do it . Need caption to be below the image and center aligned.I am working on Android

Original source