ReactNative初学笔记2.1 View组件
来源:互联网 发布:手机淘宝可以贷款么 编辑:程序博客网 时间:2024/06/07 08:55
本人只粗略了解标签语言,至于html5,js,css啥的完全外行。我认为ReactNative是移动App开发的趋势,作为一个iOS开发工程师,深知原生开发的局限性,从今天起,像个孩子一样学习RN。使用教材《React Native入门与实践》
今天在学习的时候,遇到了一个难题,1 / PixelRatio.get()在iphone 6 plus模拟器下,有问题
理想中分割线是这样的:(切换到6及以下)
网上搜索未得到解决方法,待日后继续研究
var React = require('react-native');var { AppRegistry, StyleSheet, Text, View, PixelRatio} = React;var app = React.createClass({ render: function() { return ( <View style = {styles.flex}> <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,styles.flex,styles.lineCenter]}> <Text style = {styles.font}>海外酒店</Text> </View> <View style = {[styles.center,styles.flex]}> <Text style = {styles.font}>特惠酒店</Text> </View> </View> <View style = {styles.item}> <View style = {[styles.center,styles.flex,styles.lineCenter]}> <Text style = {styles.font}>团购</Text> </View> <View style = {[styles.center,styles.flex]}> <Text style = {styles.font}>客栈,公寓</Text> </View> </View> </View> </View> ); }});var styles = StyleSheet.create({ container: { marginTop: 25, marginLeft: 5, marginRight: 5, height: 84, flexDirection: 'row', borderRadius: 5, padding: 2, backgroundColor: '#FF0067' }, item: { flex: 1, height: 80, }, center: { justifyContent: 'center', alignItems: 'center' }, flex: { flex: 1 }, font: { color: '#fff', fontSize: 16, fontWeight: 'bold' }, lineLeftRight: { borderLeftWidth: 1 / PixelRatio.get(), borderRightWidth: 1 / PixelRatio.get(), borderColor: '#fff' }, lineCenter: { borderBottomWidth: 1 / PixelRatio.get(), borderColor: '#fff' }});AppRegistry.registerComponent('demo', () => app);
0 0
- ReactNative初学笔记2.1 View组件
- ReactNative View 组件
- ReactNative组件-react-native-scrollable-tab-view
- ReactNative开发——View组件
- ReactNative初学笔记1.1flexbox布局
- ReactNative初学笔记1.2flexbox布局2
- React Native学习笔记(二)--index.android.js 内容和ReactNative组件(<Text>、AppRegistry、View、StyleSheet)及Component
- 【原创】东方耀reactnative 视频12之-view组件
- reactNative中View组件的简单使用(六)
- 初学Android,简述View组件(三)
- COM组件初学习笔记
- ReactNative学习笔记2(常用组件及其属性)
- 自定义View初学笔记之验证码
- ReactNative-Image组件
- ReactNative-Picker组件
- ReactNative-Switch开关组件
- ReactNative-WebView组件
- ReactNative开源组件
- pdf文件的页面怎么添加和删除
- AngularJs创建自己的Grid–分页组件
- navicat使用
- Linux Kernel 控制 GPIO LED 闪烁 (Blink)
- 到底是谁占用了80端口
- ReactNative初学笔记2.1 View组件
- haproxy 安装配置
- xUtils3简介
- android ndk:unsatisfiederror:no implementation found
- Swift编程规范:保持代码优美的10个方法
- CentOS 配置 samba服务器建立共享文件夹
- Win32汇编 高DPI下如何获取屏幕物理分辨率(Native solution)
- 关于苹果审核,加急审核发邮件
- Codeforces Round #345 (Div. 2) D. Image Preview __ two pointers and pretreat