使用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. python安装requests

    下面是requests的安装步骤: 1.如果系统已经装了Python,把D:\python3.6.5\Scripts添加到系统的环境变量PATH后面 2.cmd下cd到这个目录下D:\Python3. ...

  2. 8.7 C++二进制文件读写操作

    参考:http://www.weixueyuan.net/view/6413.html 总结: 二进制文件的读写稍微麻烦一些,对二进制文件的读写同样需要打开文件和关闭文件,打开和关闭方式与文本文件相同 ...

  3. php解析Excel表格并且导入MySQL数据库

    最近根据客户需求,需要增加一个导入Excel表格的功能,Excel中存放的是知识库中医知识的分类体系目录.是在thinkphp框架下编写的代码,用的是phpexcel第三方包.测试环境用的是xampp ...

  4. 阿里的maven镜像仓库,eclipse中使用maven下载jar包的时候提升速度

    <mirrors> <mirror> <id>alimaven</id> <name>aliyun maven</name> & ...

  5. 剑指Offer 44. 翻转单词顺序列 (字符串)

    题目描述 牛客最近来了一个新员工Fish,每天早晨总是会拿着一本英文杂志,写些句子在本子上.同事Cat对Fish写的内容颇感兴趣,有一天他向Fish借来翻看,但却读不懂它的意思.例如,"st ...

  6. Django App(六) Customing Admin Form

    这一篇主要是呼应第二篇时留下来的一个问题,就是如何自定义默认app admin下的Form  1.绑定数据实体 通过第二篇的努力,已经完成了数据实体到数据库的映射,可以将界面的更改保存到数据库,我们建 ...

  7. 链接属性external的使用

    //demo1.c #include<stdio.h> ; //static int x = 10; void print(void) //static void print(void) ...

  8. js封装选项卡

    <div class="forestcamp_box"> <img src="img/home_02.jpg" /> <div c ...

  9. 2018.5.2 file结构体

    f_flags,File Status Flag f_pos,表示当前读写位置 f_count,表示引用计数(Reference Count): dup.fork等系统调用会导致多个文件描述符指向同一 ...

  10. Linux Centos7下如何确认MySQL服务已经启动

    Linux CentOS一般做为服务器使用,因此,MySQL服务应该随开机自动启动的.正常情况下,查看开机自动启动的服务使用chkconfig命令,如下: #chkconfig --list 实际使用 ...