“Bereaksi Android Safeareaview asli” Kode Jawaban

Bereaksi Android Safeareaview asli

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

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

bereaksi apakah ada tampilan area yang aman untuk android

import { StyleSheet, Platform } from 'react-native';
export default StyleSheet.create({
    droidSafeArea: {
        flex: 1,
        backgroundColor: npLBlue,
        paddingTop: Platform.OS === 'android' ? 25 : 0
    },
});
Stupid Skipper

bereaksi apakah ada tampilan area yang aman untuk android

import GlobalStyles from './GlobalStyles';
import { SafeAreaView } from "react-native";

render() {
    return (
      <SafeAreaView style={GlobalStyles.droidSafeArea}>
          //More controls and such
      </SafeAreaView>
    );
  }
}
Stupid Skipper

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

Bereaksi Safeareaview Native

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

Jawaban yang mirip dengan “Bereaksi Android Safeareaview asli”

Pertanyaan yang mirip dengan “Bereaksi Android Safeareaview asli”

Lebih banyak jawaban terkait untuk “Bereaksi Android Safeareaview asli” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya