I’m trying to create an app with react native,
this is the code atm:
import { View, Text, Image } from 'react-native'
import React from 'react'
export default function Login() {
return (
<View>
<Image source={require('./../assets/images/login.jpg')}
style={{
width: '100%',
}}
/>
</View>
)
}
The problem is when I apply the width attribute, because my image just disappear.
If I don’t use that attribute it’s all good, I can use height and it’s working properly, but as soon as I use width I just see a white screen. I tried different images, different %, but same result.
PS:This error is only when I use %, if I use px is working.
Can you explain to me why this is happening?
Thank you.
I wanted the image to cover the entire width of the background.