- Create Components folder under src folder
- Add TextAreaEXP1.js file and add below Code
import React from "react";
import { Platform, StyleSheet, View, TextInput, Text } from "react-native";
const TextAreaEXP1 = () => {
return (
<View style={styles.MainContainer}>
<Text>Text Area example</Text>
<TextInput
style={styles.TextInputStyleClass}
underlineColorAndroid="transparent"
placeholder={"Type Something in Text Area."}
placeholderTextColor={"#9E9E9E"}
numberOfLines={10}
multiline={true}
/>
</View>
);
};
export default TextAreaEXP1;
const styles = StyleSheet.create({
MainContainer: {
flex: 1,
paddingTop: Platform.OS === "ios" ? 20 : 0,
justifyContent: "center"
},
TextInputStyleClass: {
textAlign: "center",
borderWidth: 2,
borderColor: "#9E9E9E",
borderRadius: 20,
backgroundColor: "#FFFFFF",
height: 150
}
});
- Open App.js file and update code as below
import React from 'react';
import { View,StyleSheet } from 'react-native';
import TextAreaEXP1 from './src/Component/TextAreaEXP1'
const App=()=> {
return (
<View style={styles.container}>
<TextAreaEXP1/>
</View>
);
}
export default App;
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
paddingTop:80
},
});
No comments:
Post a Comment