Advertisement
hasancse1991

react-native-image

Oct 25th, 2018
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component } from "react";
  2. import { Platform, StyleSheet, Text, View, Image } from "react-native";
  3.  
  4. export default class App extends Component {
  5.   render() {
  6.     return (
  7.       <View style={styles.container}>
  8.         <Text style={styles.headerText}>
  9.           Show Image From HTTP URL In React Native.
  10.         </Text>
  11.         <Image
  12.           style={{ width: "100%", height: 200, resizeMode: "stretch" }}
  13.           source={{
  14.             uri:
  15.               "https://4.bp.blogspot.com/-krdeTqQLML8/Wyf2oV7eedI/AAAAAAAABpI/OZ759swV7L8wWtt2pwBXIgp6aPz33r01gCLcBGAs/s400/fist%2Bapp.jpg"
  16.           }}
  17.         />
  18.       </View>
  19.     );
  20.   }
  21. }
  22.  
  23. const styles = StyleSheet.create({
  24.   container: {
  25.     flex: 1,
  26.     justifyContent: "center",
  27.     alignItems: "center",
  28.     backgroundColor: "#F5FCFF"
  29.   },
  30.   headerText: {
  31.     fontSize: 20,
  32.     textAlign: "center",
  33.     margin: 10,
  34.     fontWeight: "bold"
  35.   }
  36. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement