Advertisement
Felanpro

React Native (Dimensions)

May 14th, 2023
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. import { StatusBar } from 'expo-status-bar';
  2. import { Dimensions, StyleSheet, Text, View, TouchableWithoutFeedback, TouchableOpacity, TouchableHighlight, Alert, Image, SafeAreaView, Button } from 'react-native';
  3.  
  4. export default function App() {
  5. console.log(Dimensions.get("screen"));
  6.  
  7. return (
  8. <SafeAreaView style={styles.container}>
  9.  
  10. <View style = {{
  11.  
  12. backgroundColor: 'dodgerblue',
  13. width: '50%',
  14. height: 70
  15.  
  16. }}>
  17.  
  18. </View>
  19.  
  20. <StatusBar style="auto" />
  21.  
  22. </SafeAreaView>
  23. );
  24. }
  25.  
  26. const containerStyle = {backgroundColor: "orange"};
  27.  
  28. const styles = StyleSheet.create({
  29. container: {
  30. flex: 1,
  31. backgroundColor: 'orange'
  32. },
  33. });
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement