登錄界面
/**
* 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='請輸入賬號' textAlign="center"></TextInput>
<TextInput style={styles.intputStyle2} placeholder='請輸入密碼' 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',
//主軸對齊
justifyContent:'center',
//側(cè)軸
alignItems:'center',
marginTop:10
},
des:{
// 主軸方向
flexDirection:'row',
width:width*0.9,
// 主軸對齊方式
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);