React Native获取手机的各种高度 2019/07/02 移动端 JavaScript React Native 一、窗口高度即图中黄色+蓝色部分 12import { Dimensions } from "react-native";const deviceHeight = Dimensions.get('window').height; 二、屏幕高度即图中黄色+蓝色+红色部分 12import { Dimensions } from "react-native";const deviceHeight = Dimensions.get('screen').height; 三、内容高度即图中蓝色部分 1234import { StyleSheet, View, Text, ScrollView, Dimensions, PanResponder, StatusBar } from "react-native";const deviceHeight = Dimensions.get('window').height; const STATUS_BAR_HEIGHT = StatusBar.currentHeight; //即图中黄色部分const height = deviceHeight - STATUS_BAR_HEIGHT; React Native发送通知 chemistry 1 原子核 本文作者:bbcfive 版权声明:本文首发于bbcfive的博客,转载请注明出处!