React Native Text Input仅在提交或移动到其他字段后显示输入

时间:2017-02-07 18:58:23

标签: android ios mobile react-native textinput

当我开始输入时,占位符消失但我仍然看不到我只键入的内容。我只能在单击字段或提交时才能看到它。我完全看不到我在打字之后输入的文字,这非常令人沮丧。

// Scene
export default class Authentication extends Component {
  constructor(props) {
    super(props);
    this.state = { email: '', password: '' };
  }
        render() {
            return (
                <ViewContainer>
                    <StatusbarBackground/>
                    <View style={styles.container}>
                    <View>
                    <View style={styles.logoContainer}>
                    <Image source={require('../Resources/logo.png')} style={styles.logo}/>
                    </View>
                    <TextInput
                      style={styles.TextInput}
                      onChangeText={(text) => this.setState({email: text})}
                      value={this.state.email}
                      onFocus={this.onFocus}
                      autoCorrect={false}
                      returnKeyType="next"
                      keyboardType="email-address"
                      placeholder="EMAIL"
                      placeholderTextColor="white"
                    />
                    <View style={styles.inputBorder} />
                    <View style={styles.inputBorder} />
                    <TextInput
                      style={styles.TextInput}
                      onChangeText={(text) => this.setState({password: text})}
                      value={this.state.password}
                      onFocus={this.onFocus}
                      autoCorrect={false}
                      returnKeyType="done"
                      placeholder="PASSWORD"
                      secureTextEntry={true}
                      placeholderTextColor="white"
                    />
                    <View style={styles.inputBorder} />
                    <View style={styles.inputBorder} />
                    <View style={styles.buttons}>
                    <Button style={styles.login} title="Login" color="green" onPress={login}/>
                    <Button style={styles.signup} title="Signup" color="green" onPress={signup} />
                    </View>
                    </View>
                    </View>
                </ViewContainer>
            );
        }
    }

0 个答案:

没有答案