React Native Image Height Auto Example
Aug 26, 2022 . Admin

In this tutorial, you will learn react native image full height auto width. you will learn react native image height auto code example. it's simple example of how to set image height to be 100% and height to be auto in react native. I’m going to show you about react native get image height and height. You just need to some step to done react native image resizemode.
In this example,We will get Image auto height in react native.you can easy get image height using Dimensions in react native.The complete example below shows you how to do that.
Step 1: Download ProjectIn the first step run the following command to create a project.
expo init ExampleAppStep 2: App.js
In this step, You will open the App.js file and put the code.
import React from 'react'; import { StyleSheet, Text, View, Image, Dimensions } from 'react-native'; export default function App() { return ( <View style={styles.container}> <Image style={styles.img} source={require('./assets/images.jpeg')} /> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, img: { width : 200, height: Dimensions.get('window').height, resizeMode: 'contain' } });Step 3: Run Project
In the last step run your project using the below command.
expo start
You can QR code scan in Expo Go Application on mobile.
Output:

It will help you...