App.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import React, { Component } from 'react';
  2. import { AppRegistry, Image, StyleSheet, Text, View } from 'react-native';
  3. const styles = StyleSheet.create({
  4. container: {
  5. flex: 1,
  6. backgroundColor: '#fa4',
  7. alignItems: 'center',
  8. justifyContent: 'center',
  9. },
  10. });
  11. class App extends Component {
  12. render() {
  13. return (
  14. <View style={styles.container}>
  15. <Text>Open up App.js to start working on your app!</Text>
  16. <Text>Changes you make will automatically reload.</Text>
  17. <Text>Shake your phone to open the developer menu.</Text>
  18. </View>
  19. );
  20. }
  21. }
  22. export default class Bananas extends Component {
  23. render() {
  24. const pic = {
  25. uri: 'https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg',
  26. };
  27. const img = (
  28. <Image source={pic} style={{
  29. backgroundColor: 'orange',
  30. height: 110,
  31. opacity: 0.9,
  32. width: '100%',
  33. }} />
  34. );
  35. return (
  36. img
  37. );
  38. }
  39. }
  40. // skip this line if using Create React Native App
  41. // AppRegistry.registerComponent('AwesomeProject', () => Bananas);