Hi,
I have a problem with my ViewImageScreen component.
I follow Mosh in every step. My code is identical to his but on my phones it doesn’t show the image.
It only shows the closeIcon and deleteIcon.
If I change the setting of the image style then is possible to see the photo but not the icons.
I didn’t have any problems with the WelcomeScreen component.
The fact is - it doesn’t say there is a problem. It’s just not showing the background photo
This is the code:
import React from “react”;
import { Image, StyleSheet, View } from “react-native”;
import colors from “…/config/colors”;
function ViewImageScreen(props) {
return (
<View style={styles.container}>
<View style={styles.closeIcon}></View>
<View style={styles.deleteIcon}></View>
<Image
resizeMode="contain"
style={styles.image}
source={require("../assets/chair.jpg")}
/>
</View>
);
}
const styles = StyleSheet.create({
closeIcon: {
width: 50,
height: 50,
backgroundColor: colors.primary,
position: "absolute",
top: 40,
left: 30,
},
container: {
backgroundColor: colors.black,
flex: 1,
},
deleteIcon: {
width: 50,
height: 50,
backgroundColor: colors.secondary,
position: "absolute",
top: 40,
right: 30,
},
image: {
width: "100%",
height: "100%",
},
});
export default ViewImageScreen;