我是反应原生的新手,我正在尝试同时为Android和iOS制作应用程序.
目前,我有一个登录屏幕设置,但textInput中使用的键入文本和占位符文本都没有在Android的应用程序中显示(适用于iPhone).
这是代码片段和样式表:
'use strict';
import React, { Component } from 'react'
var Dimensions = require('Dimensions');
var windowSize = Dimensions.get('window');
import {
AppRegistry,
StyleSheet,
View,
Text,
TextInput,
Image
} from 'react-native';
class LoginPage extends Component {
constructor() {
super()
this.state = {
username: '',
password: ''
}
}
render() {
return (
<View style={styles.container}>
<Image style={styles.bg} source={require('./Resources/orangebackground.png')} />
<View style={styles.header}>
<Image source={require('./Resources/logo.png')} />
</View>
<View style={styles.inputs}>
<View style={styles.inputContainer}>
<Image style={styles.inputUsername} source={require('./Resources/un.png')}/>
<TextInput
style={[styles.input, styles.whiteFont]}
underlineColorAndroid={'white'}
placeholder='Username'
placeholderTextColor="white"
//value={this.state.username}
/>
</View> …Run Code Online (Sandbox Code Playgroud)