- Create Components folder under src folder
- Add TextInputWithPassword.js file and add below Code
import React from "react";
import { StyleSheet, TextInput, View, Text } from "react-native";
const TextInputWithPassword = () => {
return (
<View>
<Text> TextInput Type Style for Password example </Text>
<TextInput
secureTextEntry={true}
placeholder="Text Input For Password"
underlineColorAndroid="transparent"
style={styles.TextInputStyle}
/>
</View>
);
};
export default TextInputWithPassword;
const styles = StyleSheet.create({
TextInputStyle: {
marginBottom: 7,
height: 40,
borderWidth: 1,
borderColor: "#FF0000",
borderRadius: 6
}
});
- Open App.js file and update code as below
import React from 'react';
import { View,StyleSheet } from 'react-native';
import TextInputWithPassword from './src/Component/TextInputWithPassword'
const App=()=> {
return (
<View style={styles.container}>
<TextInputWithPassword/>
</View>
);
}
export default App;
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
paddingTop:80
},
});
No comments:
Post a Comment