Style in React Native | Style Type
App.js: -
import React, { useState } from 'react';
import { Text, Button, View, StyleSheet } from 'react-native';
import Exstyles from './exStyles';
const App = () => {
return (
<View>
<Text style={{ fontSize: 30, backgroundColor:'green' }}>Style in
react native</Text>
<Text style={styles.textBox}>Style in
react native</Text>
<Text style={styles.textBox}>Style in
react native</Text>
<Text style={Exstyles.textBox}>Style in
react native</Text>
<Text style={[styles.textBox, Exstyles.textBox, {marginTop:10}]}>Style in
react native</Text>
</View>
);
};
const styles=StyleSheet.create({
textBox:{
color:'white',
backgroundColor:'blue',
fontSize:30,
marginBottom:5,
padding:10,
textAlign:'center',
borderRadius:10,
borderColor:'red',
borderWidth:2
}
})
export default App;
-------------------------------
exStyles.js -
Comments
Post a Comment