修改登录界面样式 文字居中,图片大小自适应 review 于良
Showing
1 changed file
with
13 additions
and
4 deletions
@@ -55,6 +55,7 @@ export default class Login extends Component { | @@ -55,6 +55,7 @@ export default class Login extends Component { | ||
55 | onPress={this.props.onDeleteUserPress}> | 55 | onPress={this.props.onDeleteUserPress}> |
56 | <Image | 56 | <Image |
57 | style={styles.buttonDelete} | 57 | style={styles.buttonDelete} |
58 | + resizeMode={Image.resizeMode.contain} | ||
58 | source={require('../images/delete.png')} | 59 | source={require('../images/delete.png')} |
59 | /> | 60 | /> |
60 | </TouchableOpacity> | 61 | </TouchableOpacity> |
@@ -70,7 +71,6 @@ export default class Login extends Component { | @@ -70,7 +71,6 @@ export default class Login extends Component { | ||
70 | placeholder={'密码'} | 71 | placeholder={'密码'} |
71 | underlineColorAndroid='transparent' | 72 | underlineColorAndroid='transparent' |
72 | onChangeText={this.props.onPwdChange} | 73 | onChangeText={this.props.onPwdChange} |
73 | - value={this.props.pwd} | ||
74 | selectionColor={'white'} | 74 | selectionColor={'white'} |
75 | autoCapitalize={'none'} | 75 | autoCapitalize={'none'} |
76 | autoCorrect={false} | 76 | autoCorrect={false} |
@@ -78,8 +78,9 @@ export default class Login extends Component { | @@ -78,8 +78,9 @@ export default class Login extends Component { | ||
78 | <TouchableOpacity | 78 | <TouchableOpacity |
79 | onPress={this.props.onShowPwdPress}> | 79 | onPress={this.props.onShowPwdPress}> |
80 | <Image | 80 | <Image |
81 | - style={styles.buttonDelete} | ||
82 | - source={require('../images/eyes.png')} | 81 | + style={styles.buttonDisplayPwd} |
82 | + resizeMode={Image.resizeMode.contain} | ||
83 | + source={this.props.isDisplayPwd?require('../images/eyes.png'):require('../images/eyeopen.png')} | ||
83 | /> | 84 | /> |
84 | </TouchableOpacity> | 85 | </TouchableOpacity> |
85 | </View> | 86 | </View> |
@@ -145,12 +146,15 @@ var styles = StyleSheet.create({ | @@ -145,12 +146,15 @@ var styles = StyleSheet.create({ | ||
145 | height:40, | 146 | height:40, |
146 | paddingLeft:10, | 147 | paddingLeft:10, |
147 | color:'white', | 148 | color:'white', |
148 | - | 149 | + textAlignVertical: "center", |
150 | + paddingTop:10 | ||
149 | }, | 151 | }, |
150 | pwd: { | 152 | pwd: { |
151 | flex: 1, | 153 | flex: 1, |
152 | paddingLeft:10, | 154 | paddingLeft:10, |
153 | color:'white', | 155 | color:'white', |
156 | + textAlignVertical: "center", | ||
157 | + paddingTop:10 | ||
154 | }, | 158 | }, |
155 | button: { | 159 | button: { |
156 | marginLeft: 20, | 160 | marginLeft: 20, |
@@ -168,4 +172,9 @@ var styles = StyleSheet.create({ | @@ -168,4 +172,9 @@ var styles = StyleSheet.create({ | ||
168 | height:20, | 172 | height:20, |
169 | marginRight:10, | 173 | marginRight:10, |
170 | }, | 174 | }, |
175 | + buttonDisplayPwd: { | ||
176 | + width:25, | ||
177 | + height:18, | ||
178 | + marginRight:10, | ||
179 | + }, | ||
171 | }); | 180 | }); |
-
Please register or login to post a comment