使用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. 如何seo(搜索引擎优化)

    Seo是指遵循搜索引擎的搜索原则,对网站结构.网页文字语言和站点间互动外交等进行合理规划部署,以改善网站在搜索引擎的搜索表现,从而增加客户发现并访问网站的可能性的一个过程.

  2. 微信小程序onLaunch修改globalData的值

    //app.js App({ onLaunch: function (options) { //设置场景值到缓存中: //wx.setStorageSync("scene", op ...

  3. Java 模拟面试题

    1.面向对象的特点 继承,封装,多态 2.对象和类的区别是什么? 对象是对客观事物的抽象,类是对对象的抽象.类是一种抽象的数据类型,它们的关系是,对象是类的实例,类是对象的模板. 3.静态成员和实例成 ...

  4. 在HTML中用循环语句

    <%for(){%  > <tr> <td></td> <td></td> </tr> <%}%> 注意 ...

  5. TensorFlow函数:tf.random_shuffle

    tf.random_shuffle 函数 random_shuffle( value, seed=None, name=None ) 定义在:tensorflow/python/ops/random_ ...

  6. SVN 的搭建及使用(一)下载和搭建SVN服务器

    (本文是从博客园上的文章改编而来,其中有些关于版本问题的截图是直接引用原文的,与当前版本有可能不同) Subversion是优秀的版本控制工具,其具体的的优点和详细介绍,这里就不再多说. 首先来下载和 ...

  7. Java学习笔记40(sql:将数据库内数据存入对象中)

    新建一个数据表: use qy97; create table student( id int primary key auto_increment, sname ), gander ), age i ...

  8. 用rz、sz命令在Xshell传输文件

    用rz.sz命令在Xshell传输文件 2014-03-27 14:38:17 标签:用rz.sz命令在Xshell传输文件 Xshell很好用,然后有时候想在windows和linux之间上传或下载 ...

  9. escu问题及解决

    ************************************************************** Qt 出现“undefined reference to `vtable ...

  10. 20155208徐子涵 Exp4 恶意代码分析

    20155208徐子涵 Exp4 恶意代码分析 实践目标 1.1是监控你自己系统的运行状态,看有没有可疑的程序在运行. 1.2是分析一个恶意软件,就分析Exp2或Exp3中生成后门软件:分析工具尽量使 ...