GitHub - vivaxy/react-native-auto-height-image: 🖼️React native auto height image
🖼️React native auto height image. Contribute to vivaxy/react-native-auto-height-image development by creating an account on GitHub.
github.com
yarn add react-native-auto-height-image
npm install react-native-auto-height-image
import React, { Component } from 'react';
import AutoHeightImage from 'react-native-auto-height-image';
import image from 'gallifrey-falls.png';
export default class Demo extends Component {
render() {
return (
<View>
<AutoHeightImage
width={100}
source={image}
/>
<AutoHeightImage
width={100}
source={{uri: 'http://placehold.it/350x150'}}
/>
</View>
);
}
}
- 이미지의 높이를 자동으로 너비의 퍼센트에 따라 유동적으로 조정하려면 위와 같은 코드를 사용하면 된다
'기초다지기 > React Native' 카테고리의 다른 글
@fortawesome/react-native-fontawesome에서 fontSize가 안먹히는 이유 (0) | 2025.04.23 |
---|---|
Expo CLI & React Native CLI 비교 (0) | 2025.01.07 |
[React native] simulator Tap something to inspect it? (0) | 2023.08.18 |