[RN] React Native 实现 类似QQ 登陆页面

一、主页index.js

项目目录下index.js

/**
* @format
*/ import {AppRegistry} from 'react-native';
import App from './src/js/App';
import {name as appName} from './app.json'; AppRegistry.registerComponent(appName, () => App);

二、App.js

import React, {Component} from 'react';
import {Image, StyleSheet, Text, TextInput, TouchableOpacity, View} from 'react-native'; //屏幕信息
var dimensions = require('Dimensions');
//获取屏幕的宽度
var {width} = dimensions.get('window'); export default class App extends Component<Props> {
render() {
return (
<View style={styles.container}>
{/*头像*/}
<Image style={styles.circleImage} source={require('./logo.png')}/>
{/*账户*/}
<TextInput
style={styles.textInput}
placeholder={'请输入用户名'}
//输入框下划线
underlineColorAndroid={'transparent'}/>
{/*密码*/}
<TextInput
style={styles.textInput}
placeholder={'请输入密码'}
secureTextEntry={true}
underlineColorAndroid={'transparent'}/>
{/*无法登录 新用户*/}
{/*登录*/}
<TouchableOpacity style={styles.btnStyle}>
<Text style={styles.loginText}>登录</Text>
</TouchableOpacity>
{/*无法登录 新用户*/}
<View style={styles.canNot}>
<Text style={{color: '#4398ff'}}>无法登录</Text>
<Text style={{color: '#4398ff'}}>新用户</Text>
</View>
{/*其它登录方式*/}
<View style={styles.loginTheWay}>
<Text>其它登录方式:</Text>
<Image style={styles.image} source={require('./alipay.png')}/>
<Image style={styles.image} source={require('./wechat.png')}/>
</View>
</View>
);
}
} const styles = StyleSheet.create({
container: {
flex: ,
flexDirection: 'column',
backgroundColor: '#dddddd',
//设置次轴的对齐方式
alignItems: 'center',
},
circleImage: {
width: ,
height: ,
borderRadius: ,
borderWidth: ,
borderColor: 'white',
marginTop: ,
marginBottom: ,
},
textInput: {
height: ,
width: width,
marginBottom: ,
backgroundColor: 'white',
textAlign: 'left',
},
canNot: {
width: width - ,
marginTop: ,
flexDirection: 'row',
alignItems: 'center',
//设置主轴为两端对齐
justifyContent: 'space-between',
},
loginTheWay: {
flexDirection: 'row',
//设置次轴的对齐方式
alignItems: 'center',
justifyContent: 'flex-start',
//绝对定位
position: 'absolute',
// //距离底部还有30 距离左边还有10 这样的一个位置
bottom: ,
left: ,
},
image: {
width: ,
height: ,
marginLeft: ,
borderRadius: ,
},
btnStyle: {
height: ,
width: width - ,
borderRadius: ,
marginTop: ,
backgroundColor: '#4398ff',
justifyContent: 'center',
},
loginText: {
textAlign: 'center',
color: 'white',
textAlignVertical: 'center',
} });

具体代码见Github:

https://github.com/wukong1688/RN-BaseLoginPage

本博客地址: wukong1688

本文原文地址:https://www.cnblogs.com/wukong1688/p/10811163.html

转载请注明出处!谢谢~~

[RN] React Native 实现 类似QQ 登陆页面的更多相关文章

  1. [RN] React Native 实现 类似京东 的 沉浸式状态栏和搜索栏

    React Native 实现 类似京东 的 沉浸式状态栏和搜索栏 其原理其实就是在要 隐藏 部分的那个View 前面加入 StatusBar 代码! 代码如下: <StatusBar anim ...

  2. [RN] React Native 下实现底部标签(支持滑动切换)

    上一篇文章 [RN] React Native 下实现底部标签(不支持滑动切换) 总结了不支持滑动切换的方法,此篇文章总结出 支持滑动 的方法 准备工作之类的,跟上文类似,大家可点击上文查看相关内容. ...

  3. [RN] React Native 实现图片预览

    [RN] React Native 实现图片预览 效果预览: 代码如下: 'use strict'; import React, {Component} from 'react'; import {I ...

  4. [RN] React Native 常见基本问题归纳总结

    [RN] React Native  常见基本问题归纳总结 本问题总结涉及到版本为: "react": "16.8.3","react-native& ...

  5. [RN] React Native 关闭所有黄色警告

    [RN] React Native 关闭所有黄色警告 console.ignoredYellowBox = ['Warning: BackAndroid is deprecated. Please u ...

  6. [RN] React Native 幻灯片效果 Banner

    [RN] React Native 幻灯片效果 Banner 1.定义Banner import React, {Component} from 'react'; import {Image, Scr ...

  7. [RN] React Native 常用命令行

    [RN] React Native 常用命令行 1.查看当前版本 react-native --version 或 react-native -v 2.创建指定版本的React Native项目 1) ...

  8. [RN] React Native ScrollView去掉自带的间隔

    React Native ScrollView去掉自带的间隔 使用ScrollView时,自带了一个类似marginTop的效果,将其去掉 <ScrollView automaticallyAd ...

  9. [RN] React Native 使用 阿里 ant-design

    React Native 使用 阿里 ant-design 实例效果如图: 一.安装 npm install antd-mobile-rn --save npm install babel-plugi ...

随机推荐

  1. C#JsonConvert.DeserializeObject反序列化json字符

    需求:需要把第一个id替换掉,在序列化成json dynamic dyn = Newtonsoft.Json.JsonConvert.DeserializeObject(json); foreach ...

  2. P2711 小行星 (最大流)

    题目 P2711 小行星 解析 这道题挺巧妙的,乍一看是空间上的,无从下手,稍微转换一下就可以了. 看到题目,求消除这些行星的最少次数,就是求最小割,也就是求最大流,考虑怎样建图. 考虑当我们消去一个 ...

  3. 基于xilinx Zynq UltraScale MPSoC平台的核心板及开发板介绍-米尔科技

    近日,米尔科技推出国内首款基于xilinx Zynq UltraScale+MPSoC 平台的核心板及开发板.其优势主要有:采用16纳米制程,相比Znyq7000系列每瓦性能提升5倍,且单芯片融合4核 ...

  4. SQL server 2008数据库的备份与还原(亲测,效果良好)注意采用单用户模式呀

    .SQL数据库的备份: 1.依次打开 开始菜单 → 程序 → Microsoft SQL Server 2008 → SQL Server Management Studio → 数据库:Dsidea ...

  5. 【转载】 C#中float、double以及decimal类型有何不同

    在C#语言中,float.double以及decimal类型都可以用来表示小数,但三者还是有一定的不同,有效数字为相比的话,decimal类型的有效数字最大,float类型最小.计算浮点类型的运算,如 ...

  6. 原油petrolaeum石油 Archaic spelling of petroleum

    petrolaeum (uncountable) Archaic spelling of petroleum petroleum See also: Petroleum Contents [hide] ...

  7. 如何使用GUID硬盘分区格式安装新windows系统

    全局唯一标识分区表(GUID Partition Table,缩写:GPT)是一个实体硬盘的分区结构.目前硬盘格式有两种,一种MBR,另一个就是GUID.一般电脑买过来是windows7以上,比如wi ...

  8. 【RAC】将单实例备份集恢复为rac数据库

    [RAC]将单实例备份集恢复为rac数据库 一.1  BLOG文档结构图 一.2  前言部分 一.2.1  导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识, ...

  9. Spring IOC 总结

    IOC 简介 IOC是(Inversion of Control,控制反转)的简写.Spring提供IOC容器,将对象间的依赖关系交由Spring进行控制,避免硬编码所造成的的过度程序耦合.它由DI( ...

  10. Netlink: 内核与用户空间传输数据的socket协议

    https://en.wikipedia.org/wiki/Netlink https://stackoverflow.com/questions/12899055/how-kernel-notify ...