Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,948 members, 7,810,623 topics. Date: Saturday, 27 April 2024 at 12:17 PM

Show Image From HTTP URL In React Native - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Show Image From HTTP URL In React Native (1772 Views)

How To Fetch New URL In New Search Console ? / React Native Open Website URL In Default Browser Android Example / Get Current Page URL In PHP (2) (3) (4)

(1) (Reply)

Show Image From HTTP URL In React Native by skptricks: 3:50pm On Jul 01, 2018
Show Image From HTTP URL In React Native

In this tutorial we will explain how to display image in react native application using HTTP URL. This example covers, fetching and displaying an image from network location using Image Component of react native.

Point To Remember while loading image in Image Component.
Note that for network and data images, you will need to manually specify the dimensions of your image!
Show Image From HTTP URL in React Native

App.js
This Component helps to display image from HTTP URL. Follow the below steps, that helps to configure Image Component in App Component.

1. Add Image Component in import block.
import {
Platform,
StyleSheet,
Text,
View,
Image
} from 'react-native';

2. Add Image tag in render’s return block.
Source attribute in Image tag, where we are specifying the image location.
Also we have added inline style to Image tag, that helps to set the image size as per the device width.
<Image
style={{width: '100%', height: 200,resizeMode : 'stretch' }}
source={{uri: 'https://4.bp..com/-krdeTqQLML8/Wyf2oV7eedI/AAAAAAAABpI/OZ759swV7L8wWtt2pwBXIgp6aPz33r01gCLcBGAs/s400/fist%2Bapp.jpg'}}
/>


https://www.youtube.com/watch?v=qArk3mRoO7c

(1) (Reply)

Let Me Be Your Reliable Picker For All Your Country GIFT CARD At Dope Rate / How Do I Develop A Mobile Application Concept? / How Viable Is C++ Programming In Nigeria Job Market.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 6
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.