rn-normalized
Version:
simple function to make React Native app responsive easily
35 lines (32 loc) • 818 B
JavaScript
import React from 'react';
import { Text, View, StyleSheet } from 'react-native';
import normalized from 'rn-normalized';
const App = () => {
return (
<View style={styles.container}>
<View style={styles.box}>
<Text style={styles.text}>React Native Normalize</Text>
</View>
</View>
)
}
export default App
const styles = StyleSheet.create({
container: {
flex: 1,
},
box: {
alignItems: 'center',
justifyContent: 'center',
top: normalized(180, 'height'),
left: normalized(40),
width: normalized(300),
height: normalized(300),
borderRadius: normalized(150),
backgroundColor: '#009fcd',
},
text: {
fontSize: normalized(60),
color: 'white',
},
})