React-Native个人信息界面
最近在做一个小练习项目,用户登陆后需要跳转到用户登录信息界面,加班半个小时终于将界面的布局搞定。接触Rect-Native也有一段时间了,以前没有做过ios,只做过android,就布局和开发效率上来说,react-native的给我的感觉是开发效率要大大高于android的。下面是具体的代码:
import React from 'react-native'
import Icon from 'react-native-vector-icons/FontAwesome' let {
StyleSheet,
View,
Text,
Image
} = React var Temp = React.createClass({
render: function () {
return (
<View style={styles.container}>
<View style={styles.viewTop}>
<Text style={styles.txtTitle}>我</Text>
<Icon name='cog' style={styles.iconSetting} size={20}/>
</View>
<View style={styles.viewUser}>
<View style={styles.viewUserTop}>
<Image style={styles.imgUserTitle} source={require('../../assets/tx05.png')}/>
</View>
<Text style={styles.txtName}>微风zZ</Text>
<Text style={styles.txtGF}>关注 0 | 粉丝 0</Text>
<View style={styles.viewEdit}>
<Icon name='pencil-square-o' style={styles.iconEdit} size={15}/>
<Text style={styles.txtEdit}>编辑个人资料</Text>
</View>
</View>
<View style={styles.viewLove}>
<View style={styles.viewLoveTop}>
<Text style={styles.txtCommon}>我的喜爱 1</Text>
<Icon style={styles.iconCommon} name='angle-right' size={20}/>
</View>
<View style={styles.viewContent}>
<Image style={styles.imgLove} source={require('../../assets/recommend1.png')}/>
</View>
</View>
<View style={styles.viewCommon}>
<Text style={styles.txtCommon}>我的点评</Text>
<Icon style={styles.iconCommon} name='angle-right' size={20}/>
</View>
<View style={styles.viewCommon}>
<Text style={styles.txtCommon}>我参与的标签</Text>
<Icon style={styles.iconCommon} name='angle-right' size={20}/>
</View>
</View>
)
}
}) let styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#F0F0F0'
},
viewTop: {
height: 60,
backgroundColor: '#F0F0F0',
alignItems: 'center',
borderBottomWidth: 1,
borderBottomColor: '#B7B7B7',
flexDirection: 'row'
},
txtTitle: {
flex: 1,
marginLeft: 10
},
iconSetting: {
marginRight: 10
},
viewUser: {
height: 250,
backgroundColor: '#F0F0F0'
},
viewUserTop: {
height: 100,
alignItems: 'center',
justifyContent: 'center'
},
imgUserTitle: {
height: 80,
width: 80,
borderRadius: 40
},
txtName: {
alignSelf: 'center'
},
txtGF: {
alignSelf: 'center',
marginTop: 40
},
viewEdit: {
width: 150,
marginTop: 20,
height: 30,
flexDirection: 'row',
alignSelf: 'center',
backgroundColor: '#E6E6E6',
justifyContent: 'center',
alignItems: 'center',
borderRadius: 10
},
txtEdit: {
marginLeft: 5,
alignSelf: 'center',
color: '#7997C7'
},
iconEdit: {
color: '#7997C7',
marginTop: 5
},
viewLove: {
height: 150,
borderBottomWidth: 10,
borderBottomColor: '#F0F0F0',
backgroundColor: 'ffffff'
},
viewLoveTop: {
height: 40,
flexDirection: 'row',
alignItems: 'center'
},
txtCommon: {
marginLeft: 15,
flex: 1
},
iconCommon: {
marginRight: 10
},
imgLove: {
height: 90,
width: 90,
margin: 10,
marginTop: 0
},
viewCommon: {
height: 50,
borderBottomWidth: 10,
borderBottomColor: '#F0F0F0',
flexDirection: 'row',
alignItems: 'center',
backgroundColor: '#ffffff'
}
}) module.exports = Temp
React-Native个人信息界面的更多相关文章
- 腾讯优测优分享 | 探索react native首屏渲染最佳实践
腾讯优测是专业的移动云测试平台,旗下的优分享不定时提供大量移动研发及测试相关的干货~ 此文主要与以下内容相关,希望对大家有帮助. react native给了我们使用javascript开发原生app ...
- 探索react native首屏渲染最佳实践
文 / 腾讯 龚麒 0.前言 react native给了我们使用javascript开发原生app的能力,在使用react native完成兴趣部落安卓端发现tab改造后,我们开始对由react n ...
- React Native移动开发实战-3-实现页面间的数据传递
React Native使用props来实现页面间数据传递和通信.在React Native中,有两种方式可以存储和传递数据:props(属性)以及state(状态),其中: props通常是在父组件 ...
- 是时候了解React Native了
文章首发于简书,欢迎关注 随着科技的发展,手机开发也在向好的方向不停的转变.IOS和Android两大手机操作横空出世,称霸江湖.我们每开发一个手机软件最少都需要开发这两个终端. 两大操作系统都在不断 ...
- React Native之获取通讯录信息并实现类通讯录列表(ios android)
React Native之获取通讯录信息并实现类通讯录列表(ios android) 一,需求分析 1,获取通讯录信息,筛选出通讯录里有多少好友在使用某个应用. 2,获取通讯录信息,实现类通讯录,可拨 ...
- 【腾讯Bugly干货分享】React Native项目实战总结
本文来自于腾讯bugly开发者社区,非经作者同意,请勿转载,原文地址:http://dev.qq.com/topic/577e16a7640ad7b4682c64a7 “8小时内拼工作,8小时外拼成长 ...
- React Native:使用 JavaScript 构建原生应用
[转载] 本篇为联合翻译,译者:寸志,范洪春,kmokidd,姜天意 数月前,Facebook 对外宣布了正在开发的 React Native 框架,这个框架允许你使用 JavaScript 开发原生 ...
- React Native之 Navigator与NavigatorIOS使用
前言 学习本系列内容需要具备一定 HTML 开发基础,没有基础的朋友可以先转至 HTML快速入门(一) 学习 本人接触 React Native 时间并不是特别长,所以对其中的内容和性质了解可能会有所 ...
- React Native之坑总结(持续更新)
React Native之坑总结(持续更新) Genymotion安装与启动 之前我用的是蓝叠(BlueStack)模拟器,跑RN程序也遇到了一些问题,都通过搜索引擎解决了,不过没有记录. 但是Blu ...
- React Native APP结构探索
APP结构探索 我在Github上找到了一个有登陆界面,能从网上获取新闻信息的开源APP,想来研究一下APP的结构. 附上原网址:我的第一个React Native App 具体来讲,就是研究一个复杂 ...
随机推荐
- html进阶css(4)
盒子模型-边框 首先请看下图 <!doctype html> <html> <head> <meta charset="utf-8"> ...
- Python3.5入门学习记录-File
在Python中,操作文件对象使用open函数来创建,下表列出了常用的操作file的函数: 序号 方法及描述 1.file.close() 关闭文件.关闭后文件不能再进行读写操作. 2.file.fl ...
- Python学习笔记4(函数与模块)
1.Python程序的结构 Python的程序由包(package).模块(module)和函数组成. 模块是处理一类问题的集合,由函数和类组成. 包是由一系列模块组成的集合.包是一个完成特定任务的工 ...
- Python codes
Vertification of an assignment from Stochastic Processing. Using Brute Force and "itertools&quo ...
- poj1511/zoj2008 Invitation Cards(最短路模板题)
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud Invitation Cards Time Limit: 5 Seconds ...
- 一种无new创建对象的方法
var L=function(){ var obj = { age:38, live:true, job:"web dev" }; obj.name = "zhouhui ...
- GIT 实验
服务器环境:linux + git + gitolite(gitolite是什么,说白了就是安装后建了一个仓库,管理员用户可以通过修改并上传配置文件实现GIT仓库及其权限的管理.提醒:别用那个gito ...
- c# Parallel并行运算
string str = ""; DataTable dt=new DataTable(); dt.Columns.Add("name", typeof(Sys ...
- BZOJ 2875 随机数生成器
http://www.lydsy.com/JudgeOnline/problem.php?id=2875 题意:给出mod,a,c,g,x0,n,xn=(a*xn-1+c)%mod,求xn%g 求A* ...
- 原创:应用串行NOR闪存提升内存处理能力
在嵌入式系统中,NOR闪存一直以来仍然是较受青睐的非易失性内存,NOR器件的低延时特性可以接受代码执行和数据存储在一个单一的产品.虽然NAND记忆体已成为许多高密度应用的首选解决方案,但NOR仍然是低 ...