Grokking React Native
0% completed
Using Images and Backgrounds
A remote image without a width and a height does not appear on the screen, even when its address is correct. The reason is that the app cannot know the size of a file it has not downloaded yet, so you must supply one. Here is Ana's profile picture, loaded from an address on the internet and sized by its style.
import { Image, StyleSheet, View } from 'react-native'; const App = () => { return ( <View style={styles.screen}> <Image source={{ uri: 'https://reactnative.dev/img/tiny_logo.png' }} style={styles.avatar} /> </View> ); };
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%