- Create Components folder under src folder
- Add CircleOvalShapeEXP1.js file and add below Code
import React from "react";
import { StyleSheet, View } from "react-native";
const CircleOvalShapeEXP1 = () => {
return (
<View style={styles.container}>
<View style={styles.CircleShapeView} />
<View style={styles.OvalShapeView} />
</View>
);
};
export default CircleOvalShapeEXP1;
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
margin: 10
},
CircleShapeView: {
width: 150,
height: 150,
borderRadius: 150 / 2,
backgroundColor: "#FF0000"
},
OvalShapeView: {
marginTop: 20,
width: 100,
height: 100,
backgroundColor: "#FF0000",
borderRadius: 50,
transform: [{ scaleX: 2 }]
}
});
- Open App.js file and update code as below
import React from 'react';
import { Text,View,StyleSheet } from 'react-native';
import CircleOvalShapeEXP1 from './src/Component/CircleOvalShapeEXP1'
const App=()=> {
return (
<View style={styles.container}>
<CircleOvalShapeEXP1/>
</View>
);
}
export default App;
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
paddingTop:80
},
});
No comments:
Post a Comment