React Native – Image

Image is used for displaying images. It supports different sources, such as network URLs, local images, and static resources.

Use Cases:

  • Displaying images from the web or local files.
  • Displaying icons or other graphical elements.

Example:

import React from 'react';
import { View, Image, StyleSheet } from 'react-native';

const App = () => {
  return (
    <View style={styles.container}>
      <Image 
        style={styles.image}
        source={{ uri: 'https://reactnative.dev/img/tiny_logo.png' }} 
      />
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
  image: {
    width: 100,
    height: 100,
  },
});

export default App;

Tutorials Deck

TutorialsDeck is striving to provide the best learning material on technical and non-technical subjects.

Languages

Web Technologies

Database

Trending Technologies

© 2024. All rights reserved.

Contact Us @ tutorialsdeck06@gmail.com