1
rated 0 times
[
7]
[
6]
/ answers: 1 / hits: 5361
/ 4 Years ago, wed, may 20, 2020, 12:00:00
How do I change the text input color inside the TextInput
element in react native elements I tried passing the color=red
to the component but for some reason it doesn't work.
Here is the code I used:
import React, { useState } from react;
import { StyleSheet, View } from react-native;
import { Text, Button, Input } from react-native-elements;
import Icon from react-native-vector-icons/MaterialIcons;
import colors from ../config/colors;
function LoginScreen() {
const [email, setEmail] = useState();
const [password, setPassword] = useState();
return (
<View style={styles.Input}>
<Input
style={styles.TextInput}
placeholder=Your email
value={email}
onChangeText={setEmail}
autoCapitalize=none
autoCorrect={false}
leftIcon={<Icon name=email size={20} color=#B3C1B3 />}
/>
<Input
secureTextEntry
placeholder=Your password
value={password}
onChangeText={setPassword}
autoCapitalize=none
autoCorrect={false}
leftIcon={<Icon name=lock size={20} color=#B3C1B3 />}
/>
</View>
);
}
const styles = StyleSheet.create({
Input: {
top: 2%,
width: 70%,
left: 15%,
justifyContent: center,
alignItems: center,
},
});
export default LoginScreen;
More From » reactjs