zoukankan      html  css  js  c++  java
  • 登录界面的搭建

    实现的效果如下:  界面有点丑,图片什么的懒得找了,所以...你懂得!!! 但是基本界面的布局还是实现了.

    代码如下:  注释很清楚哟!!!

    /**
     * Sample React Native App
     * https://github.com/facebook/react-native
     * @flow
     */
    
    import React, { Component } from 'react';
    import {
        AppRegistry,
        StyleSheet,
        Text,
        View,
        TextInput,
        Image,
    } from 'react-native';
    
    class LoginView extends Component {
        render() {
            return (
                <View style ={styles.container}>
    
               {/*注释的写法 :  <Text>我是登录界面</Text>*/}
    
                {/*头像*/}
                <Image source = {require('./img/thumb.png')} style = {styles.iconStyle}/>
                {/*账号和密码*/}
                <TextInput placeholder = {'请输入用户名'} style = {styles.inputStyle}/>
                <TextInput placeholder = {'请输入密码'} password = {true} style = {styles.inputStyle}/>
                {/*登录*/}
                <View style = {styles.logBtnStyle}>
                   <Text style = {{color: 'white'}}>登录</Text>
                </View>
                <View style = {styles.settingStyle}>
                   <Text>无法登录</Text>
                   <Text>新用户</Text>
                </View>
                {/*其他登录方式*/}
                <View style = {styles.otherLogStyle}>
                   <Text>其他登录方式:</Text>
                   <Image source = {require('./img/weixin.png')} style = {styles.otherImgStyle}/>
                   <Image source = {require('./img/weixin.png')} style = {styles.otherImgStyle}/>
                   <Image source = {require('./img/weixin.png')} style = {styles.otherImgStyle}/>
    
            </View>
                </View>
        );
        }
    }
    
    const styles = StyleSheet.create({
        container: {
            flex: 1,
            backgroundColor: '#dddddd',
            // 侧轴对齐方式
            alignItems: 'center'
    
        },
        inputStyle: {
    
            // 间距
            // marginTop: 25,
            marginBottom: 1,
            // 背景颜色
            backgroundColor: 'white',
            // 边框
            borderWidth: 1,
            // 高度
            height: 38,
            borderColor: '#ebebeb',
            // 内容居中
            textAlign: 'center',
        },
        iconStyle: {
    
            // 间距
            marginTop: 40,
            marginBottom: 20,
            // 宽度
             80,
            // 高度
            height: 80,
            // 圆角
            borderRadius: 40,
            // 宽度
            borderWidth: 2,
            // 边框颜色
            borderColor: 'white',
        },
        logBtnStyle: {
    
            // 背景颜色
            backgroundColor: 'blue',
             300,
            height: 30,
            marginTop: 20,
            // marginBottpm: 20,
            justifyContent: 'center',
            alignItems: 'center',
        },
        settingStyle: {
    
            marginTop: 10,
            flexDirection: 'row',
            // 主轴对齐方式
            justifyContent: 'space-between',
             350,
        },
        otherLogStyle: {
            // 主轴对齐
            flexDirection: 'row',
            // 侧轴对齐
            alignItems: 'center',
            // backgroundColor: 'red',
            // 绝对定位
            position: 'absolute',
            bottom: 10,
            left: 20,
        },
        otherImgStyle: {
             60,
            height: 60,
            borderRadius: 30,
        }
    });
    
    // 输出组件
    module.exports = LoginView;
  • 相关阅读:
    mysql开启skip-name-resolve 导致root@127.0.0.1(localhost)访问引发的ERROR 1045 (28000)错误解决方案
    php的类型运算符instanceof(用于确定一个 PHP 变量是否属于某一类 class 的实例)
    PHP通过__call实现简单的AOP(主事务后的其他操作)比如前置通知,后置通知
    页面返回刷新或H5监听(手机的)返回键
    微信公众号分享的引导页(附素材)
    mysql服务器无法连接10055错误解决示例
    Eclipse安装svn插件的几种方式
    mysql导入和导出数据
    eclipse的常用快捷键
    springmvc乱码配置
  • 原文地址:https://www.cnblogs.com/pengsi/p/5877034.html
Copyright © 2011-2022 走看看