Skip to content

Instantly share code, notes, and snippets.

@gutomarzagao
Last active March 24, 2018 18:40
Show Gist options
  • Save gutomarzagao/9d5d9aecb99fa5d4eb4646fe6bb07866 to your computer and use it in GitHub Desktop.
Save gutomarzagao/9d5d9aecb99fa5d4eb4646fe6bb07866 to your computer and use it in GitHub Desktop.
React Native bug
import React, { Component } from 'react';
import {
View,
StyleSheet,
Image,
} from 'react-native';
const styles = StyleSheet.create({
root: {
flex: 1,
},
header: {
height: 300,
backgroundColor: 'blue',
},
content: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
// backgroundColor: 'green',
},
image: {
width: 250,
resizeMode: 'contain',
backgroundColor: 'red',
},
});
const someImage = require('../img/empty.png');
export default class App extends Component {
render() {
return (
<View style={styles.root}>
<View style={styles.header} />
<View style={styles.content}>
<Image source={someImage} style={styles.image} />
</View>
</View>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment