display image as big as possible react native
<Image style={{ flex: 1, width: "100%", resizeMode: "contain" }} source={{ uri: "https://picsum.photos/200" }}></Image>
display image as big as possible react native
<Image style={{ flex: 1, width: "100%", resizeMode: "contain" }} source={{ uri: "https://picsum.photos/200" }}></Image>
react native asign width to image
First import Dimensions from react-native
import { Dimensions } from 'react-native';
then you have to get the dimensions of the window
const win = Dimensions.get('window');
Now calculate ratio as
const ratio = win.width/541; //541 is actual image width
now the add style to your image as
imageStyle: {
width: win.width,
height: 362 * ratio, //362 is actual height of image
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us