- Create Components folder under src folder
- Add TextEXP.js file and add below Code
import React from "react";
import { Text, View, StyleSheet } from "react-native";
const RootViewBackgroundColorSet = () => {
return (
<View>
<Text>View Background Color example </Text>
<Text>Line 1</Text>
<Text>Line 2</Text>
<Text>Line 2</Text>
</View>
);
};
export default RootViewBackgroundColorSet;
- Open App.js file and update code as below
import React from 'react';
import { View,StyleSheet } from 'react-native';
import RootViewBackgroundColorSet from './src/Component/RootViewBackgroundColorSet'
const App=()=> {
return (
<View style={styles.container}>
<RootViewBackgroundColorSet/>
</View>
);
}
export default App;
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#FF0000",
alignItems: 'center',
paddingTop:80
},
});
No comments:
Post a Comment