地址:

源码

运行效果



无别的效果,代码如下

//index.js
/**
* @format
* @lint-ignore-every XPLATJSCOPYRIGHT1
*/ import {AppRegistry} from 'react-native';
import App from './App'; AppRegistry.registerComponent('ABNB_clone', () => App);
import React, {Component} from 'react';
import { AppRegistry, View } from 'react-native';
import LoggedOut from './src/screens/LoggedOut';
// 登陆组件 class App extends Component {
render() {
return (
<View>
<LoggedOut />
</View>
)
}
} AppRegistry.registerComponent('App', () => App); export default App;

封装的RoundedButton组件

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Text, View, TouchableHighlight, StyleSheet} from 'react-native';
import colors from '../../styles/colors'; export default class RoundedButton extends Component {
render() {
const {
text,
textColor,
background,
handleOnPress,
icon
} = this.props;
const backgroundColor = background || 'transparent';
const color = textColor || colors.black;
return (
<TouchableHighlight
style={[{backgroundColor}, styles.wrapper]}
onPress={handleOnPress}
>
<View style={styles.buttonTextWrapper}>
{icon}
<Text style={[{color},styles.buttonText]}>{text}</Text>
</View>
</TouchableHighlight>
)
}
} RoundedButton.PropTypes = {
text: PropTypes.string.isRequired,
textColor: PropTypes.string,
background: PropTypes.string,
icon: PropTypes.object,
handleOnPress: PropTypes.func.isRequired,
} const styles = StyleSheet.create({
wrapper: {
display: 'flex',
padding: 15,
borderRadius: 40,
borderWidth: 1,
borderColor: colors.white,
height: 50,
marginBottom: 15,
alignItems: 'center',
},
buttonText: {
fontSize: 16,
width: '100%',
textAlign: 'center'
},
buttonTextWrapper: {
flexDirection: 'row',
justifyContent: 'flex-end', } });
//LoggedOut
import React, {Component} from 'react';
import { Image, StyleSheet, Text, View, TouchableHighlight } from 'react-native';
import RoundedButton from '../components/buttons/RoundedButton';
import colors from '../styles/colors';
import Icon from 'react-native-vector-icons/FontAwesome'; const airbnbLogo = require('../images/airbnb-logo.png') class LoggedOut extends Component {
onFacebookPress(){
alert('Facebook press')
} onCreateAccountPress(){
alert('Create Account')
} onMoreOptionsPress(){
alert('More Options')
} render() {
return (
<View style={styles.wrapper}>
<View style={styles.welcomeWrapper}>
<Image
source={airbnbLogo}
style={styles.logo}
/>
<Text style={styles.welcomeText}>
Welcome to Airbnb
</Text>
<RoundedButton
text="Continue with Facebook"
textColor={colors.green01}
background={colors.white}
icon={<Icon name="facebook" size={20} style={styles.facebookButtonIcon} />}
handleOnPress={this.onFacebookPress}
/>
<RoundedButton
text="Create Account"
textColor={colors.white}
background={colors.green01}
handleOnPress={this.onCreateAccountPress}
/>
<TouchableHighlight
style={styles.moreOptionsButton}
onPress={this.onMoreOptionsPress}
>
<Text style={styles.moreOptionsButtonText}>More Options</Text>
</TouchableHighlight>
<View style={styles.termsAndConditions}>
<Text style={styles.termsText}>
By Tapping Continue. Create An Account or More
</Text>
<Text style={styles.termsText}>options, </Text>
<Text style={styles.termsText}>I agree to Airbnb's</Text>
<TouchableHighlight style={styles.linkButton}>
<Text style={styles.termsText}>Terms of Service</Text>
</TouchableHighlight>
<Text style={styles.termsText}> ,</Text>
<TouchableHighlight style={styles.linkButton}>
<Text style={styles.termsText}>Payments, Terms of Service</Text>
</TouchableHighlight>
<Text style={styles.termsText}> ,and</Text>
<TouchableHighlight style={styles.linkButton}>
<Text style={styles.termsText}>Privacy Policy</Text>
</TouchableHighlight>
<Text style={styles.termsText}> ,</Text>
<TouchableHighlight style={styles.linkButton}>
<Text style={styles.termsText}>Nondiscrimination Policy.</Text>
</TouchableHighlight>
</View>
</View>
</View>
)
}
} export default LoggedOut; const styles = StyleSheet.create({
wrapper: {
flex: 1,
display: 'flex',
backgroundColor: colors.green01,
},
welcomeWrapper: {
flex: 1,
display: 'flex',
marginTop: 30,
padding: 20
},
logo: {
width: 50,
height: 50,
marginTop: 50,
marginBottom: 40,
},
welcomeText: {
fontSize: 30,
height: 60,
color: colors.white,
fontWeight: '300',
},
facebookButtonIcon: {
color: colors.green01,
position: 'relative',
left: 30,
zIndex: 8,
width: 20,
},
moreOptionsButton: {
marginTop: 15,
width: 50,
},
moreOptionsButtonText: {
color: colors.white,
width: 200,
fontSize: 20,
height: 30,
},
termsAndConditions: {
flexWrap: 'wrap',
alignItems: 'flex-start',
flexDirection: 'row',
marginTop: 40
},
termsText: {
color: colors.white,
fontSize: 12,
fontWeight: '600',
height: 20
},
linkButton: {
borderBottomWidth: 0.5,
display: 'flex',
borderBottomColor: colors.white,
}
})

第一个完毕~

【水滴石穿】AB-B-Clone的更多相关文章

  1. 基于 HTML5 WebGL 的挖掘机 3D 可视化应用

    前言 在工业互联网以及物联网的影响下,人们对于机械的管理,机械的可视化,机械的操作可视化提出了更高的要求.如何在一个系统中完整的显示机械的运行情况,机械的运行轨迹,或者机械的机械动作显得尤为的重要,因 ...

  2. 基于 HTML5 + WebGL 的 3D 可视化挖掘机

    前言 在工业互联网以及物联网的影响下,人们对于机械的管理,机械的可视化,机械的操作可视化提出了更高的要求.如何在一个系统中完整的显示机械的运行情况,机械的运行轨迹,或者机械的机械动作显得尤为的重要,因 ...

  3. 基于 HTML5 + WebGL 实现 3D 挖掘机系统

    前言 在工业互联网以及物联网的影响下,人们对于机械的管理,机械的可视化,机械的操作可视化提出了更高的要求.如何在一个系统中完整的显示机械的运行情况,机械的运行轨迹,或者机械的机械动作显得尤为的重要,因 ...

  4. LeetCode: Clone Graph 解题报告

    Clone GraphClone an undirected graph. Each node in the graph contains a label and a list of its neig ...

  5. wrk,ab,locust,Jmeter 压测结果比较

    背景: 项目需要对一批接口进行压测,要求是接口的QPS(Quest Per Second每秒请求数)达到6万以上由于楼主一直使用的压力测试工具是jmeter,但是jmeter单台电脑无法达到6万的QP ...

  6. Git从码云Clone代码到本地

    Git从码云或者Github 克隆代码到本地 1.下载安装Git,傻瓜式下一步下一步即可... 2.配置Git: 2.1.选择你要clone到本地的路径:右键--->$ Git Bash Her ...

  7. ab

     ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed ...

  8. SCVMM中Clone虚拟机失败显示Unsupported Cluster Configuration状态

    在SCVMM进行虚拟机的Clone,虽然失败了,但是Clone出虚拟机却显示在SCVMM控制台的虚拟机的列表中,并且状态是Unsupported Cluster Configuration.无法修复, ...

  9. [LeetCode] Clone Graph 无向图的复制

    Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's ...

  10. 使用ab对nginx进行压力测试

    nginx以高并发,省内存著称. 相信大多数安装nginx的同学都想知道自己的nginx性能如何. 我想跟大家分享下我使用ab工具的压力测试方法和结果, ab是针对apache的性能测试工具,可以只安 ...

随机推荐

  1. PhoneInfoga---用于电话号码的信息收集和OSINT侦察工具

    PhoneInfoga 是仅使用免费资源扫描电话号码的最先进工具之一. 目标是首先在任何国际电话号码上收集标准信息, 如国家,地区,运营商和线路类型,并且准确性非常高. 然后在搜索引擎上搜索足迹以尝试 ...

  2. java的堆栈通俗理解

    java内存模型有堆内存和栈内存, 初学者可能看官方解释很模糊 堆:new 出来的对象或者数组都存放在堆中: List <String> list =new ArrayList<St ...

  3. Python - 基本数据类型及其常用的方法之字典和布尔值

    字典 特点:{"key1": value1, "key2":value2}  , 键值对中的值可以为任何数据类型,键不能为列表.字典(无法哈希),布尔值可以为键 ...

  4. matlab实现一次性实现多个文件夹图片转化为.mat文件

    %这里是主函数:命名为readImg.m; clc;clear; %---read_image; filepath = 'G:\人脸重建\data\src_all\';%图片路径可以根据自己需要修改; ...

  5. Windows下Git的下载、安装、设置用户名和邮箱、创建版本库等

    Git官网:https://git-scm.com/ 一.Git下载 官网首页下载,当前最新版本:2.24.1 本人下载的是Git for Windows版本:Git-2.24.1.2-64-bit. ...

  6. 关于display:flex;兼容写法

    display: -moz-box; /* Firefox */ display: -ms-flexbox; /* IE10 */ display: -webkit-box; /* Safari */ ...

  7. HTML:把两张图片并排(行)显示

    <table><tr><td><img src=pic1.jpg border=0></td><td><img src=p ...

  8. Java的split()方法

    在java中,split方法很常用,但是有些时候我们发现并不管用,不管用的情况:split("."),split("^"), 管用的情况:split(" ...

  9. day38 10-Spring的Bean的属性的注入

    后处理bean,如果是返回bean,那么什么都不做直接把这个类原封不动地给你返回回去. 在它执行一些逻辑方法的时候对它进行逻辑增强,比如说进行时间监控,权限管理,日志的记录等等. 要做肯定是对正常的类 ...

  10. BZOJ4719[NOIP2016提高组Day1T2] 天天爱跑步

    #261. [NOIP2016]天天爱跑步 描述 提交 自定义测试 小C同学认为跑步非常有趣,于是决定制作一款叫做<天天爱跑步>的游戏.<天天爱跑步>是一个养成类游戏,需要玩家 ...