地址:

源码

运行效果



无别的效果,代码如下

//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. CentOS7.4 安装JDK 步骤

    1.先在官网下载jdk1.8的压缩文件 2.用putty将压缩文件拷到home目录下 3.新建一个/home/jdk1.8目录 :  mkdir  /home/jdk1.8 4.将压缩文件解压到hom ...

  2. 转载:JVM内存分代策略

    Java虚拟机根据对象存活的周期不同,把堆内存划分为几块,一般分为新生代.老年代和永久代(对HotSpot虚拟机而言),这就是JVM的内存分代策略. 为什么要分代? 堆内存是虚拟机管理的内存中最大的一 ...

  3. docker和宿主机之间复制文件

    从主机复制到容器sudo docker cp host_path containerID:container_path 从容器复制到主机sudo docker cp containerID:conta ...

  4. VMWare下载安装以及创建虚拟机教程

    参考博客https://blog.csdn.net/qq_39135287/article/details/83993574 下载 1.打开官网https://www.vmware.com/cn.ht ...

  5. mysql 安装失败 start service执行不下去

    简单说一下自己安装mysql的经历坑点,新手应该都会遇到.新买了一个电脑,第一次安装的情况:在网上下载好几个不同的mysql,安装都在最后一步执行的时候,执行不下去,最后打开客户端,就是闪一下就消失了 ...

  6. C++ base64 opencv Mat 转换

    static std::string base64Decode(const char* Data, int DataByte) { //解码表 const char DecodeTable[] = { ...

  7. LeetCode389Find the Difference找不同

    给定两个字符串 s 和 t,它们只包含小写字母. 字符串 t 由字符串 s 随机重排,然后在随机位置添加一个字母. 请找出在 t 中被添加的字母. 示例: 输入: s = "abcd&quo ...

  8. Leetcode561.Array Partition I数组拆分1

    给定长度为 2n 的数组, 你的任务是将这些数分成 n 对, 例如 (a1, b1), (a2, b2), ..., (an, bn) ,使得从1 到 n 的 min(ai, bi) 总和最大. 示例 ...

  9. MySQL8.0.17 - Multi-Valued Indexes 简述

    本文主要简单介绍下8.0.17新引入的功能multi-valued index, 顾名思义,索引上对于同一个Primary key, 可以建立多个二级索引项,实际上已经对array类型的基础功能做了支 ...

  10. web前端学习(四)JavaScript学习笔记部分(8)-- JavaScript 浏览器对象

    1.window对象 1.1.window对象: window对象是BOM的核心,window对象指当前的浏览器窗口 所有javaScript全局对象.函数以及变量均自动生成为window对象的成员 ...