Reputation: 237
I'm just getting started with react native. There's an image I want to resize but adding width and height acts like image cropping.
Here's the code,
const App = () => {
return (
<SafeAreaView>
<View>
<Text>Hello world!</Text>
<Image
source={require('./assets/logos/logo.png')}
style={styles.logo}
/>
</View>
</SafeAreaView>
);
};
const styles = StyleSheet.create({
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24,
},
logo: {
height: 50,
},
highlight: {
fontWeight: '700',
},
});
Upvotes: 0
Views: 1062
Reputation: 1751
There are many image props available. Have a look at them from official documentation. Try the resizeMode prop.
Upvotes: 1