使用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. <文档学习>AirSim/using_car.md Choosing Your Vehicle: Car or Multirotor

    如何在AirSim中使用汽车 默认情况下,AirSim中使用的车型为多转子multirotor. 如果你想使用汽车,那么只需在你的settings.json(https://github.com/Mi ...

  2. Java面试(一) -- 基础部分(1)

    1 .一个".java" 源文件中是否可以包括多个类(不是内部类)?有什么限制?答:可以有多个类,但只能有一个 public 的类,并且 public 的类名必须与文件名相一致.. ...

  3. go语言常见问题总结

    go语言中的goroutine和其它语言中的coroutine有什么相同和不同? coroutine 意味着支持将控制转移到另一个协程的明确手段.也就是说,程序员在确定coroutine何时应该暂停执 ...

  4. Verilog强制激励语法

    Verilog强制激励语法 1. 在一个过程块中,可以用两种不同的方式对信号变量或表达式进行连续赋值. 过程连续赋值往往是不可以综合的,通常用在测试模块中. 两种方式都有各自配套的命令来停止赋值过程. ...

  5. 积累的关于linux的安装卸载软件基本命令

    Linux安装.卸载软件   在linux环境中,尤其是cenos中安装过一些软件,一般是二进制安装与源码安装,现小结一下linux中的安装与卸载. 一.通常Linux应用软件的安装包有三种: 1)  ...

  6. bat中errorlevel与%errorlevel%的区别

    bat中errorlevel与%errorlevel%的区别? 他们都是判断上个命令的返回值.当使用if errorlevel 值 cmmand 句式时,它的含义是:如果返回的错误码值大于或等于值 的 ...

  7. L2-008. 最长对称子串(思维题)*

    L2-008. 最长对称子串 参考博客 #include <iostream> using namespace std; int main() { string s; getline(ci ...

  8. web(五)CSS引入方式,编写规范及调试

    CSS (Cascading Style Sheets)层叠样式表 ,是由万维网联盟(W3C)制定的标准 CSS的主要作用: 美化html元素的外观,例如设定背景颜色.字体等. 对网页元素进行布局.以 ...

  9. Gym101889B. Buggy ICPC(打表)

    比赛链接:传送门 题目: Problem B – Buggy ICPC Author : Gabriel Poesia, Brasil Alan Curing is a famous sports p ...

  10. ElasticSearch(四):关于es的一些基础知识讲解

    上一篇博客更新完之后,我发现一个问题:在我创建索引的时候依旧无法准确的理解每个字段的意义,所以就有了这个. 1. 关于索引 1.1 关于索引的一些基础知识 在创建标准化索引的时候,我们传入的请求体如下 ...