Horje
react native make safe view in mobile Code Example
react native make safe view in mobile
//import libraries to create components
import React from 'react'
import { Text, StyleSheet, View, SafeAreaView, StatusBar } from 'react-native'

//create a component that return some jsx/simple function
//======following code use SafeAreaView and statusBar.currentHeight to 
//    solve this problem===============================
const App = () => {
  return (
    <SafeAreaView style={styles.container}>
      <Text style={styles.textStyle}>hello world</Text>
    </SafeAreaView>
  )
}

//Create a StyleSheet object to style the component
const styles = StyleSheet.create({
  container: {
    flex: 1,
    marginTop: StatusBar.currentHeight || 0,
  },
})

//export the component, so it can be used in other parts of the app
export default App




Javascript

Related
dinamically add checked to checkbox Code Example dinamically add checked to checkbox Code Example
bash sort json alphabetically Code Example bash sort json alphabetically Code Example
html anchor tag javascript confirm Code Example html anchor tag javascript confirm Code Example
useQuery apollo more than one Code Example useQuery apollo more than one Code Example
uuid timestamp for javascript Code Example uuid timestamp for javascript Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8