Created
January 16, 2018 07:24
-
-
Save alien3d/6a9506f4940b3ba8073f93b7be6c2b8f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* This is for test image bugs constant | |
* @flow | |
*/ | |
import React, { Component } from 'react'; | |
import { | |
Platform, | |
StyleSheet, | |
Text, | |
View, | |
Image | |
} from 'react-native'; | |
export default class App extends Component<{}> { | |
constructor(props){ | |
super(props); | |
this.state= { | |
url:"https://en.facebookbrand.com/wp-content/uploads/2016/05/FB-fLogo-Blue-broadcast-2.png" | |
} | |
} | |
render() { | |
let link_test ="https://en.facebookbrand.com/wp-content/uploads/2016/05/FB-fLogo-Blue-broadcast-2.png"; | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.welcome}> | |
Normal image link | |
</Text> | |
<Image source= {{ uri:"https://en.facebookbrand.com/wp-content/uploads/2016/05/FB-fLogo-Blue-broadcast-2.png" }} style={{ width:100,height:100 }}/> | |
<Text>Image link using standard variable</Text> | |
<Image source ={{ uri:link_test }} /> | |
<Text>Image using state </Text> | |
<Image source ={{ uri:this.state.url }} /> | |
<Text>{this.state.url}</Text> | |
</View> | |
); | |
} | |
} | |
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, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment