'Not able to type in Text Input in Android
Not able to type in Text Input in Android.
While making an app in React Native I realized that there is a text input in which I am not able to type. This problem is happening with Android only for IOS it is working fine. And I have to mention that I am not using Android Studio so the is no Manifest.xml. Here is the code:
import React from 'react';
import {View,TextInput, StyleSheet} from 'react-native';
class Login extends React.Component(){
constructor(){
super();
this.state = {
password: "",
}
}
render(){
return(
<View style={styles.container}>
<TextInput
placeholder="Password"
placeholderTextColor="rgba(0,0,0,0.6)"
caretHidden={false}
maxLength={35}
autoComplete={false}
autoCorrect={false}
style={styles.input}
secureTextEntry={true}
onChangeText={(val) => {
this.setState({
password: val,
});
}}
value={this.state.password}
/>
</View>
)
}
}
const styles = StyleSheet.create({
container:{
flex: 1,
},
input:{
backgroundColor: '#ccc',
height: 50,
width: 320,
alignSelf: 'center',
borderRadius: 50,
textAlign: 'left',
marginTop: 25,
flex: 0.2,
fontSize: 18,
fontFamily: 'sans-serif',
fontWeight: "500",
paddingLeft: 10,
color: 'black',
}
})
Solution 1:[1]
@AleksandarZoric thanks for your suggestion.
So got the answer using @AleksandarZoric's help.
Just have to comment out all the flex styles. If it works, uncomment the flex styles and just try to decrease the values and it will work.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Shubham Deswal |
