“Отрешите Native Safeareaview” Ответ

React Native Android Safeareaview

import { StyleSheet, Platform, StatusBar } from "react-native";

export default StyleSheet.create({
  AndroidSafeArea: {
    flex: 1,
    backgroundColor: "white",
    paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0
  }
});
rumbo

SafeareaView

import SafeAreaView from 'react-native-safe-area-view';

<SafeAreaView forceInset={{ top: 'always' }}>
  <View>
    <Text>Yeah, I'm safe too!</Text>
  </View>
</SafeAreaView>
Xenophobic Xenomorph

SafeareaView React Native Android

//if it won't wrok when exporting from 'react-native'
npm install react-native-safe-area-context 
import { SafeAreaView } from 'react-native-safe-area-context '; 
Alba Garza

Отрешите Native Safeareaview

import React from 'react';
import { StyleSheet, Text, SafeAreaView } from 'react-native';

const App = () => {
  return (
    <SafeAreaView style={styles.container}>
      <Text style={styles.text}>Page content</Text>
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  text: {
    fontSize: 25,
    fontWeight: '500',
  }
});

export default App;
MAKSTYLE119

Ответы похожие на “Отрешите Native Safeareaview”

Вопросы похожие на “Отрешите Native Safeareaview”

Больше похожих ответов на “Отрешите Native Safeareaview” по JavaScript

Смотреть популярные ответы по языку

Смотреть другие языки программирования