Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Adding Images | Section
React Native Basics

bookAdding Images

Veeg om het menu te tonen

To display images in React Native, you use the Image component.

This allows you to show avatars, icons, or any visual content on the screen.

Example:

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

export default function App() {
  return (
    <View>
      <Text>Profile</Text>

      <Image
        source={{ uri: 'https://i.pravatar.cc/150' }}
        style={{ width: 100, height: 100 }}
      />

      <Text>Alex Johnson</Text>
    </View>
  );
}

The source property defines where the image comes from. In this case, it uses a URL.

The style property is required for images. Without width and height, the image will not be visible.

Now your screen starts to look more like a real mobile interface.

question mark

What is required for an image to be visible in React Native?

Selecteer het correcte antwoord

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 3

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

Sectie 1. Hoofdstuk 3
some-alt