我正在尝试使用 React Native 的 StatusBar.currentHeight https://facebook.github.io/react-native/docs/statusbar 获取 Android 设备上的状态栏高度.在像素 2 上,该变量为 24,而实际上状态栏高度为 19。有谁知道在所有使用 React Native 的设备上获得正确状态栏高度的方法?
最佳答案
您可以尝试下载expo-constants
模块。
import Constants from 'expo-constants';
...
const STATUSBAR_HEIGHT = Constants.statusBarHeight
关于android - React Native 在 android 上获得正确的状态栏高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56359342/