@ohmi/react-native-status-bar-height
v2.6.0-0.0.3
Published
Get status bar height for React Native App
Keywords
Readme
[!TIP] Gitee 地址
介绍
本项目基于react-native-status-bar-height开发。
安装与使用
npm
npm install --save @ohmi/react-native-status-bar-heightyarn
yarn add @ohmi/react-native-status-bar-heightUsage getStatusBarHeight(skipAndroid: boolean = false)
import { getStatusBarHeight } from "react-native-status-bar-height";
// 44 - on iPhone X
// 20 - on iOS device
// X - on Android platfrom (runtime value)
// 0 - on all other platforms (default)
console.log(getStatusBarHeight());
// Will be 0 on Android, because you pass true to skipAndroid
console.log(getStatusBarHeight(true));Link
无需 link
约束与限制
无
规格表
| Name | Description | Type | Required | Platform | HarmonyOS Support | | -------------------- | ------------------- | -------- | -------- | -------- | ----------------- | | getStatusBarHeight | 获取状态栏高度 | 静态方法 | no | All | 支持 | | isIPhoneX | 判断是 IPhoneX | 静态方法 | no | All | 支持 | | isIPhoneXMax | 判断是 IPhoneXMax | 静态方法 | no | All | 支持 | | isIPhone12 | 判断是 IPhone12 | 静态方法 | no | All | 支持 | | isIPhone12Max | 判断是 IPhone12Max | 静态方法 | no | All | 支持 | | isIPhoneWithMonobrow | 判断是刘海屏 iphone | 静态方法 | no | All | 支持 | | isExpo | 判断是 Expo 环境 | 静态方法 | no | All | 支持 |
遗留问题
无
开源协议
本项目基于 MIT License (MIT) ,请自由地享受和参与开源。
