react-native 学习之Image篇
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
Image
} from 'react-native'; class machaoProject extends Component {
render() {
return (
<View style={styles.container}>
<View style={ styles.topBgView}> <View style={styles.unitView} >
<Image
source={require('./Images/001.png')}
style={styles.imageStyle}
/>
<Text style = {styles.textStyle}>
美食
</Text>
</View> <View style={styles.unitView} >
<Image
source={require('./Images/002.png')}
style={styles.imageStyle}
/>
<Text style = {styles.textStyle}>
电影
</Text>
</View> <View style={styles.unitView} >
<Image
source={require('./Images/003.png')}
style={styles.imageStyle}
/>
<Text style = {styles.textStyle}>
酒店
</Text>
</View> <View style={styles.unitView} >
<Image
source={require('./Images/004.png')}
style={styles.imageStyle}
/>
<Text style = {styles.textStyle}>
KTV
</Text>
</View>
</View> <View style = {styles.topBgView}> <View style={styles.unitView} >
<Image
source={require('./Images/005.png')}
style={styles.imageStyle}
/>
<Text style = {styles.textStyle}>
外卖
</Text>
</View> <View style={styles.unitView} >
<Image
source={require('./Images/006.png')}
style={styles.imageStyle}
/>
<Text style = {styles.textStyle}>
优惠买单
</Text>
</View> <View style={styles.unitView} >
<Image
source={require('./Images/007.png')}
style={styles.imageStyle}
/>
<Text style = {styles.textStyle}>
你说呢
</Text>
</View> </View> </View>
);
}
} const styles = StyleSheet.create({
container: {
marginLeft: 5,
marginTop: 20,
marginRight: 5,
},
topBgView: {
flexDirection: 'row',
backgroundColor: 'red',
marginTop: 10,
},
unitView: {
width: 70 ,
},
imageStyle: {
alignSelf: 'center',
width: 45,
height: 45,
},
textStyle: {
marginTop: 0,
textAlign: 'center',
fontSize: 15,
color: '#555555'
}
}); AppRegistry.registerComponent('machaoProject', () => machaoProject);

react-native 学习之Image篇的更多相关文章
- React Native 学习-01
React Native 学习 (学习版本 0.39) 一.环境配置 二.IDE选择 webstorm 1.webstorm配置 ①.首先是可以选择使用汉化包汉化.eu68 ②.安装插件和外部库. 由 ...
- react native 学习一(环境搭配和常见错误的解决)
react native 学习一(环境搭配) 首页,按照http://reactnative.cn/docs/0.30/getting-started.html#content上的介绍,下载安装pyt ...
- React Native 学习资料
React Native 学习资料 学习资料 网址 React Native中文网 https://reactnative.cn/
- React Native 学习(三)之 FlexBox 布局
React Native 学习(三)之 FlexBox 布局
- React Native 学习笔记--进阶(二)--动画
React Native 进阶(二)–动画 动画 流畅.有意义的动画对于移动应用用户体验来说是非常必要的.我们可以联合使用两个互补的系统:用于全局的布局动画LayoutAnimation,和用于创建更 ...
- react native 学习资料整理
入门教程 深入浅出 React Native:使用 JavaScript 构建原生应用 http://www.appcoda.com/react-native-introduction/ 中文版 h ...
- iOS 写给iOS开发者的React Native学习路线(转)
我是一名iOS开发者,断断续续一年前开始接触React Native,最近由于工作需要,专职学习React Native也有一个多月了.网络上知识资源非常的多,但能让人豁然开朗.迅速学习的还是少数,我 ...
- React Native学习方法论
这是我技术公众号的第一篇文章,也是React Native系列文章的第一篇,对我的文章感兴趣的可以加我微信16230091进行关注. 本文表面上讲React Native(以下简称RN),实际上对于学 ...
- react native学习资料
一:基础学习: react-native中文文档(react native中文网,人工翻译,官网完全同步)http://react-native.cn/docs/getting-started.htm ...
- 写给iOS开发者的React Native学习路线(转)
我是一名iOS开发者,断断续续一年前开始接触React Native,最近由于工作需要,专职学习React Native也有一个多月了.网络上知识资源非常的多,但能让人豁然开朗.迅速学习的还是少数,我 ...
随机推荐
- svn 应该忽略的文件(visual studio)
*.o *.lo .la ## .*.rej .rej .~ ~ .# .DS_Store thumbs.db Thumbs.db *.bak *.class *.exe *.dll *.mine * ...
- replace实现正则过滤替换非法字符
html+js结构如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http: ...
- 【luogu】 P1880 石子合并
原题原题原题原题原题 先贴上错误代码... ↓错误代码↓ #include <iostream> #include <cstdio> #include <cstring& ...
- [转]定位占用oracle数据库cpu过高的sql
今天在吃饭的时候我的朋友的数据库出现了问题,cpu占用率为97%,当我看到这个问题的时候我就想到了或许是sql导致的此问题,由于忍不住吃饭,暂时没有帮他看这个问题,这是我饭后自己模拟的故障,进行的分析 ...
- 用 string 进行插入、替代、查找输出下标等操作
string s; s = "; string::iterator it; it = s.begin();//让s指向第一个元素 cout << s; system(" ...
- Windows系统上的.Net版本和.NETFramework的C#版本
前言 注:本文内容摘自维基百科,用于在墙内时当作笔记看. WinForm 需要.Net最低版本 2.0 WPF需要的.Net最低版本 3.0 (Win7及之上版本自带) C#版本 版本 语言规格 日期 ...
- SQLite3
记录一个基础的IOS下SQLite的例子: @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; NSAr ...
- Python黑帽编程1.3 Python运行时与包管理工具
Python黑帽编程1.3 Python运行时与包管理工具 0.1 本系列教程说明 本系列教程,采用的大纲母本为<Understanding Network Hacks Attack and ...
- js中几种实用的跨域方法原理详解
这里说的js跨域是指通过js在不同的域之间进行数据传输或通信,比如用ajax向一个不同的域请求数据,或者通过js获取页面中不同域的框架中(iframe)的数据.只要协议.域名.端口有任何一个不同,都被 ...
- Python yield与实现
Python yield与实现 yield的功能类似于return,但是不同之处在于它返回的是生成器. 生成器 生成器是通过一个或多个yield表达式构成的函数,每一个生成器都是一个迭代器(但是迭 ...