使用Image

1. 引用

import { Image } from 'react-native';

2. 使用

format:

<Image source={{}} style{{}} />

例如:

<Image source={{uri: 'https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg'}}
style={{width: , height: }}/>

源代码:

App.js

import React from 'react';
import { StyleSheet, Text, View, Image } from 'react-native'; export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<Image source={{uri: 'https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg'}}
style={{width: , height: }}/>
</View>
);
}
} const styles = StyleSheet.create({
container: {
flex: ,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});

Reference:

1. Learn the Basics - v0.59

Learn the Basics - RN2的更多相关文章

  1. How do I learn machine learning?

    https://www.quora.com/How-do-I-learn-machine-learning-1?redirected_qid=6578644   How Can I Learn X? ...

  2. Learn golang: Top 30 Go Tutorials for Programmers Of All Levels

    https://stackify.com/learn-go-tutorials/ What is Go Programming Language? Go, developed by Google in ...

  3. (转) [it-ebooks]电子书列表

    [it-ebooks]电子书列表   [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Obj ...

  4. Async All the Way

    Asynchronous code reminds me of the story of a fellow who mentioned that the world was suspended in ...

  5. (copy) Top Ten Reasons not to use the C shell

    http://www.grymoire.com/Unix/CshTop10.txt ========================================================== ...

  6. Programming Entity Framework 翻译(2)-目录2-章节

    How This Book Is Organized 本书组织结构 Programming Entity Framework, Second Edition, focuses on two ways ...

  7. delphi 开发者 linux 实务(转)

    Linux Essentials for Delphi Developers   There is currently no way using Delphi to target Linux. Lon ...

  8. All About Python

    Part one: Learn the Basics Hello, World! print "Hello,World!" Variables and Types Python i ...

  9. cg tut

    Gesture Drawing with Alex Woo Gesture Drawing with Alex Woo and Louis Gonzales http://eisneim.com/?p ...

随机推荐

  1. restful规范整理

    restful的十条规范 restful一共有十条规范,但其并不是规定.可以不去遵守,是一种软件风格 1.API与客户端交互,通常使用https协议 2.域名:https://api.baidu.co ...

  2. Javascript中的this指向。

    一.JavaScript中的函数 在了解this指向之前,要先弄明白函数执行时它的执行环境是如何创建的,这样可以更清楚的去理解JavaScript中的this指向. function fn(x,y,n ...

  3. 自动化测试-2.seleniumIDE

    一.安装步骤 1. 打开Firefox浏览器 2. 打开https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/versions/,点击 ...

  4. linux ar命令参数及用法详解--linux建立、修改或抽取备存文件命

    功能说明:建立或修改备存文件,或是从备存文件中抽取文件. 语 法:ar[-dmpqrtx][cfosSuvV][a<成员文件>][b<成员文件>][i<成员文件>] ...

  5. iOS开发 SVN回退到某一个版本

    1.选择你要恢复的工程,(注意:从SVN上checkout下来的工程不要改变,移动位置) 2.找到SVN的导航栏,点击“Working Copy”--->"Revert" 3 ...

  6. 本地maven库导入架包

    mvn install:install-file -DgroupId=com.alipay -DartifactId=sdk-java -Dversion=20170725114550 -Dpacka ...

  7. Python导入jar包

    一.环境准备 1.Python 3.6 64位+jre 64位+win64位(jre和Python位数一致) 2.安装jpype,安装的时候输入 pip install jpype1 2.1安装提示e ...

  8. ImageLorderUtil

    import android.content.Context;import android.graphics.Bitmap;import android.os.Environment; import ...

  9. python:学习自顶向下程序设计:竞技体育模拟

    学习过程记录: 一,需求及框架: 二:程序代码: #sports.py from random import random def main(): #熟悉函数的调用 printInfo() probA ...

  10. 关于if...else语句的小注意

    if...else是一个使用非常频繁的条件语句,在条件满足时执行if下的代码,条件不满足时执行else下的代码.但在使用过程中会由于粗心犯一些错误. 比如我想要把性别的默认值设置为“男”,应该进行如下 ...