[Wondgirl]从零开始学React Native之View(四)
来源:互联网 发布:杭电网络攻防平台 编辑:程序博客网 时间:2024/05/20 04:28
index.ios.js如下:
/** * Sample React Native App * https://github.com/facebook/react-native * @flow */import React, { Component } from 'react';import { AppRegistry, StyleSheet, Text, View, PixelRatio} from 'react-native';export default class demo extends Component { render() { return ( <View style={styles.container}> <View style={[styles.item,styles.center]}> <Text style={styles.font}>机票</Text> </View> <View style={[styles.item,styles.lineLeftRight]}> <View style={[styles.center,{flex:1},styles.lineCenter]}> <Text style={styles.font}>火车票</Text> </View> <View style={[styles.center,{flex:1}]}> <Text style={styles.font}>接送机</Text> </View> </View> <View style={[styles.item,styles.lineLeftRight]}> <View style={[styles.center,{flex:1},styles.lineCenter]}> <Text style={styles.font}>汽车票</Text> </View> <View style={[styles.center,{flex:1}]}> <Text style={styles.font}>用车</Text> </View> </View> </View> ); }}//样式const styles = StyleSheet.create({ item:{ flex:1, height:80, borderColor:'blue', borderWidth:1, backgroundColor:'#ff0067' }, container: { borderWidth:1, borderColor:'red', flexDirection:'row', marginTop:40, marginLeft:20, marginRight:20 }, font:{ color:'#fff', fontSize:16, fontWeight:'bold' }, center:{ justifyContent:'center', alignItems:'center' }, lineCenter:{ borderBottomWidth:1/PixelRatio.get(), borderColor:'#fff' }, lineLeftRight:{ borderLeftWidth:1/PixelRatio.get(), borderRightWidth:1/PixelRatio.get(), borderColor:'#fff' }});AppRegistry.registerComponent('demo', () => demo);
0 0
- [Wondgirl]从零开始学React Native之View(四)
- [Wondgirl]从零开始学React Native之环境搭建(一)
- [Wondgirl]从零开始学React Native之工程创建(二)
- [Wondgirl]从零开始学React Native之FlexBox布局(三)
- [Wondgirl]从零开始学React Native之Text(五)
- [Wondgirl]从零开始学React Native之image(六)
- [Wondgirl]从零开始学React Native之ES5 ES6语法对比(七)
- 从零学React Native之07View
- 从零开始学React Native App开发
- 从零开始学React Native App开发
- 从零开始学React Native App开发
- React Native 之 View使用
- 从零开始异世界之React Native
- React Native之react-native-scrollable-tab-view详解
- 从零开始学习React Native
- React Native从零开始(四)打包发布(Android)
- React Native控件之View视图解析
- React Native控件之View视图讲解
- No suitable driver found for jdbc
- sublime text不能安装插件,there are no packages available for installation。
- 程序员学习网站
- APNS 学习总结(一)
- DLX
- [Wondgirl]从零开始学React Native之View(四)
- 文件下载工具类
- SendInput模拟鼠标消息的发送
- QML学习之基本元素TextInput, TextField, TextEdit, TextArea介绍
- java去警告(@SuppressWarnings)
- Immutable bitmap passed to Canvas constructor
- 周五随笔
- TCP长连接与短连接的区别
- 使用jQuery插件Flot,绘制饼图