Learn the Basics - RN2
使用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的更多相关文章
- 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? ...
- 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 ...
- (转) [it-ebooks]电子书列表
[it-ebooks]电子书列表 [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Obj ...
- Async All the Way
Asynchronous code reminds me of the story of a fellow who mentioned that the world was suspended in ...
- (copy) Top Ten Reasons not to use the C shell
http://www.grymoire.com/Unix/CshTop10.txt ========================================================== ...
- Programming Entity Framework 翻译(2)-目录2-章节
How This Book Is Organized 本书组织结构 Programming Entity Framework, Second Edition, focuses on two ways ...
- delphi 开发者 linux 实务(转)
Linux Essentials for Delphi Developers There is currently no way using Delphi to target Linux. Lon ...
- All About Python
Part one: Learn the Basics Hello, World! print "Hello,World!" Variables and Types Python i ...
- cg tut
Gesture Drawing with Alex Woo Gesture Drawing with Alex Woo and Louis Gonzales http://eisneim.com/?p ...
随机推荐
- Python多线程基本操作
多线程类似于同时执行多个不同程序,多线程运行有如下优点: 使用线程可以把占据长时间的程序中的任务放到后台去处理. 用户界面可以更加吸引人,这样比如用户点击了一个按钮去触发某些事件的处理,可以弹出一个进 ...
- 用setTimeout模拟setInterval的功能
偶然看到这个题目,稍微写了下,做个笔记,不足之处请指正 //用setTimeout模仿setInterval var MyInterVal = function(fun,tm){ if(this == ...
- jmeter性能测试的小小实践
项目描述: 被测试网站: www.cnblogs.com 指标:响应时间及错误率 场景:线程数--20: Ramp-Up period(in second 10)--10: 循环次数--10 测试步骤 ...
- LAMP架构(三)
第十九课 LAMP架构(三) 目录 一.配置防盗链 二.访问控制Directory 三.访问控制FilesMatch 四.限定某个目录禁止解析php 五.限制user_agent 六.php相关配置 ...
- firstPage
自己写的科比的一个简单介绍的网页,画面,布局还是太垃圾了,图片放大缩小标签不知道,简直难受. <!DOCTYPE html><html> <head> <me ...
- Problem B: 平面上的点和线——Point类、Line类 (II)
Description 在数学上,平面直角坐标系上的点用X轴和Y轴上的两个坐标值唯一确定,两点确定一条线段.现在我们封装一个“Point类”和“Line类”来实现平面上的点的操作. 根据“append ...
- javascript 跨域请求详细分析(终极跨域解决办法)
自从我接触前端以来,接手的项目里面很大部分都是前后端分离的,后端只提供接口,前端根据后端接口渲染出实际页面.个人觉得这是一个挺好的模式,前后端各自负责各自的模块,分工明确,而且也给前端更大的发挥空间. ...
- elasticsearch 使用快照进行备份
Elasticsearch也提供了备份集群中索引数据的策略——snapshot API.它会备份整个集群的当前状态和数据,并保存到集群中各个节点共享的仓库中.这个备份的进程是增量备份的,在第一次备份的 ...
- 关于Ble通信库BluetoothKit的使用 以及可能出现的问题分析
首先,这个库是用于BLE(低功耗蓝牙)通信的,地址:https://github.com/dingjikerbo/BluetoothKit 当然,也可以选择根据andorid提供的底层接口自己完成这部 ...
- Cortex-M3 跳转到指定bin执行
跳转前指定sp和msp: #if defined(__GNUC__) __attribute__(( naked )) static void set_sp(unsigned long addr) { ...