Skip to content

Instantly share code, notes, and snippets.

@damathryx
Created May 29, 2017 05:52
Show Gist options
  • Save damathryx/70283fd2e790130fa0ae679300462b8f to your computer and use it in GitHub Desktop.
Save damathryx/70283fd2e790130fa0ae679300462b8f to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
ScrollView,
Text,
Image,
View
} from 'react-native';
export default class ImageTest extends Component {
render() {
return (
<ScrollView>
{[0,1,2,3,4,5,6].map((key) => (
<View key={key}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
))}
<Image
source={{ uri: "http://books.google.com/books/content?id=PCDengEACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api" }}
style={{
width: 100,
height: 100,
backgroundColor: 'red',
margin: 2,
borderWidth: 2,
borderColor: 'orange',
}}
resizeMode="cover"
/>
<Image
source={{ uri: "https://www.nissan-cdn.net/content/dam/Nissan/ph/vehicles/almera/product_code/product_version/overview/15TDI_VERSb011x.jpg.ximg.l_full_m.smart.jpg" }}
style={{
width: 100,
height: 100,
backgroundColor: 'red',
margin: 2,
borderWidth: 2,
borderColor: 'orange',
}}
resizeMode="cover"
/>
<Image
source={{ uri: "https://edmullen.net/test/rc.jpg" }}
style={{
width: 100,
height: 100,
backgroundColor: 'red',
margin: 2,
borderWidth: 2,
borderColor: 'orange',
}}
resizeMode="cover"
/>
</ScrollView>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('ImageTest', () => ImageTest);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment