'React-Native: image is not showing
I write the given code but the image is not showing the app stop in the building.enter image description here when I run on the emulator stuck in the building process. I try all things but no response.
``` import React from "react";
import { Image, StyleSheet, View, Dimensions} from "react-native";
const dimensions = Dimensions.get('window');
const imageHeight = Math.round(dimensions.width * 9 / 16); //calculate with aspect
ratio
const imageWidth = dimensions.width;
'function App() {
return (
<View>
<Image
style={styles.backgroundImage}
source={require('D:\nativeproject\AwesomeProject\images\abl.jpg')}
/>
</View>
);
}
const styles = StyleSheet.create({
backgroundImage: {
height: imageHeight,
width: imageWidth,
zIndex: 1,
},
});
export default App; ```
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
