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也有一个多月了.网络上知识资源非常的多,但能让人豁然开朗.迅速学习的还是少数,我 ...
随机推荐
- Erlang error handling
Erlang error handling Contents Preface try-catch Process link Erlang-way error handling OTP supervis ...
- Angularjs ng-if和ng-show的区别
ng-if:判断条件,为true时向html中插入节点,否则从html中移除节点: ng-show: 简单的显示和隐藏(display) 坑点:ng-if会创建一个新的作用域(scope),如果内部元 ...
- DirectX游戏编程(一):创建一个Direct3D程序
一.环境 Visual Studio 2012,DirectX SDK (June 2010) 二.准备 1.环境变量(如没有配置请添加) 变量名:DXSDK_DIR 变量值:D:\Software\ ...
- HTML5、canvas颜色拾取器
效果图: 代码: <!doctype html> <html lang="en"> <head> <meta charset=" ...
- TP字母函数
http://wenku.baidu.com/view/2a0ec9c13c1ec5da50e27099.html?from=search
- JDBC增删改查简单测试
首先编写一个entity以便与数据库表文件相对应 lyTable.java public class LyTable implements java.io.Serializable { private ...
- 智能路由器操作系统OpenWrt
小米路由器的“MiWiFi”又让路由器成了关键词,每台智能路由器的系统是该款产品的亮点之一,其系统肯定有不少“好玩”的地方.为自己的智能路由器量身打造系统,并且纷纷开发了适合智能手机.平板电脑等使用的 ...
- MySQL 基础及性能优化工具
数据库,用户及权限 常用用户管理操作 # 创建本地用户 abc create user abc@localhost # 创建内网能够访问的用户 abc create user abc@'192.168 ...
- MongoDB 之C#实践
官方驱动:https://github.com/mongodb/mongo-csharp-driver/downloads.下载后,还提供了一个酷似msdn的帮助文档. samus驱动:https:/ ...
- iOS 真机调试不能连接网络的排错过程
开发环境: macOS 10.12.1 Xcode 8.1 Qt 5.8 gSOAP 2.8 iPhone 6S+iOS 10.1.1 问题: 使用 Qt Quick 写了一个跨平台的应用,在Wi ...