npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@react-native-ohos/react-native-iphone-screen-helper

v2.3.0

Published

A library to help you design your react-native app for the iPhone

Readme

模板版本:v0.4.0

本项目基于 react-native-iphone-screen-helper 开发。

该第三方库的仓库已迁移至 Gitcode,且支持直接从 npm 下载,新的包名为:@react-native-ohos/react-native-iphone-screen-helper 版本所属关系如下: | 三方库名称 | 三方库版本 | 发布信息 | 支持RN版本 | Autolink | 编译API版本 | 社区基线版本 | npm地址 | | ------------ | ------------ | ------------------------------ | ------------- | ------------- |------------------------ | ------------- | ------------- | | @react-native-ohos/react-native-iphone-screen-helper | ~ 2.3.0 | Gitcode Releases | 0.82.* | 否 | API12+ | 2.2.1 | Npm Address | | @react-native-ohos/react-native-iphone-screen-helper | ~ 2.2.0 | Gitcode Releases | 0.77.* | 否 | API12+ | 2.1.2 | Npm Address | | @react-native-ohos/react-native-iphone-screen-helper | ~ 2.1.1 | Gitcode Releases | 0.72.* | 否 | API12+ | 2.1.1 | Npm Address | | @react-native-oh-tpl/react-native-iphone-screen-helper | <= 2.1.1-0.0.1@deprecated | Github Releases(deprecated) | 0.72.* | 否 | API12+ | 2.1.1 | Npm Address |

1. 安装与使用

进入到工程目录并输入以下命令:

npm

# 0.72
npm install @react-native-oh-tpl/react-native-iphone-screen-helper

# 0.77/0.82
npm install @react-native-ohos/react-native-iphone-screen-helper

yarn

# 0.72
yarn add @react-native-oh-tpl/react-native-iphone-screen-helper

# 0.77/0.82
yarn add @react-native-ohos/react-native-iphone-screen-helper

下面的代码展示了这个库的基本使用场景:

[!WARNING] 使用时 import 的库名不变。

import React, { useState, useEffect } from 'react';
import { getStatusBarHeight } from 'react-native-iphone-screen-helper'
import { View } from 'react-native';

const ScreenHelperDemo: React.FC = (): JSX.Element => {
    const [currentHeight, setCurrentHeight] = useState<number>(0)

    useEffect(() => {
        const barHeight = getStatusBarHeight()
        setCurrentHeight(barHeight)
    }, [])

    return (
        <>
            <View style={{ height: currentHeight, borderBottomWidth: 1 }} />
        </>
    )
}

export default ScreenHelperDemo;

2. 约束与限制

2.1. 兼容性

本文档内容基于以下版本验证通过:

  1. RNOH: 0.72.86; SDK: HarmonyOS 6.0.0.47 (API Version 20); IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.107;
  2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0.47 (API Version 20); IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.107;
  3. RNOH: 0.82.7; SDK: HarmonyOS 6.0.1 Release SDK; IDE: DevEco Studio 6.0.1 Release; ROM: 6.0.0.328 SP26;

3. API

[!TIP] "Platform"列表示该属性在原三方库上支持的平台。

[!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。

| Name | Description | Type | Required | Platform | HarmonyOS Support | | :--- | :---------- | ---- | -------- | ---- | ------------ | | isIphoneX | 判断是否为iPhone X或更新的带刘海/灵动岛的机型 | boolean | No | All | Yes | | isDynamicIsland | 判断是否为iPhone X或灵动岛机型 | boolean | No | All | Yes | | ifIphoneX | 针对iPhone X及后续机型创建样式的方法 | stylesheets | No | All | Yes | | getStatusBarHeight | 获取状态栏高度 | number | No | All | Yes | | getBottomSpace | 获取底部安全区域高度(iPhone X为34,其他为0) | number | No | All | Yes |

4. 遗留问题

5. 其他

6. 开源协议

本项目基于 The MIT License (MIT) ,请自由地享受和参与开源。