ReactNative→登錄界面

登錄界面
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Image,
    TextInput
} from 'react-native';

var Dimensions = require('Dimensions');
var {width, height} = Dimensions.get('window');

export default class helloworld extends Component {

  render() {

    return (
        <View style={styles.container}>

          <Image source={require('./img/bag.png')} style={styles.icon} />

          <TextInput style={styles.intputStyle1} placeholder='請(qǐng)輸入賬號(hào)' textAlign="center"></TextInput>
          <TextInput style={styles.intputStyle2} placeholder='請(qǐng)輸入密碼' textAlign="center" secureTextEntry={true}></TextInput>

          <View style={styles.loginview}>

            <Text>登錄</Text>

          </View>

          <View style={styles.des}>

            <Text>無法登錄</Text>
            <Text>新登錄</Text>

          </View>

          <View style={styles.bottomStyle}>

            <Text>其他方式登錄</Text>
            <Image source={require('./img.bag.png')} style={styles.image}/>
            <Image source={require('./img.bag.png')} style={styles.image}/>
            <Image source={require('./img.bag.png')} style={styles.image}/>

          </View>


        </View>
    );
  }
}


const styles = StyleSheet.create({
  container: {
    flex:1,
    backgroundColor:'#efefef',

    //側(cè)軸方向
    alignItems : 'center',

    paddingTop: 40,
  },
  icon:{

    width:60,
    height:60,
    borderRadius:30,
    marginBottom:30
  },
  intputStyle1:{
    width:width,
    height:40,
    backgroundColor:'white',
  },
  intputStyle2:{
    width:width,
    height:40,
    backgroundColor:'white',
    marginTop:10
  },
  loginview:{

    width:width*0.9,
    height:40,
    backgroundColor:'blue',
    //主軸對(duì)齊
    justifyContent:'center',
    //側(cè)軸
    alignItems:'center',
    marginTop:10

  },
  des:{
     // 主軸方向
    flexDirection:'row',
    width:width*0.9,
    // 主軸對(duì)齊方式
    justifyContent:'space-between',
  },
  bottomStyle:{
    // 主軸方向
    flexDirection:'row',
    alignItems:'center',
    position:'absolute',
    bottom:20,
    // justifyContent:'flex-start',
    left:20
  },
  image:{
    width:30,
    height:30,
    marginLeft:15,
    borderRadius:15,
  }

});

AppRegistry.registerComponent('helloworld', () => helloworld);

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容