开始使用
复制一个包含安装步骤和此插件的完整Markdown指南的设置提示。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-home-indicator`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/home-indicator/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
您可以使用我们的 AI 助手设置来安装插件。使用以下命令将 Capgo 技能添加到您的 AI 工具中:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins然后使用以下提示:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-home-indicator` plugin in my project.如果您更喜欢手动设置,请按照以下命令安装插件并遵循以下平台特定的说明:
bun add @capgo/capacitor-home-indicatorbunx cap sync导入
导入import { HomeIndicator } from '@capgo/capacitor-home-indicator';API概述
API概述hide
隐藏隐藏 iOS 屏幕底部的主屏幕指示器。
这会使 iOS 主屏幕指示器条目不可见,提供更沉浸式的全屏体验。用户仍然可以通过滑动上方来访问主屏幕,但指示器不会在他们开始手势之前可见。
仅限 iOS。对 Android 或 Web 无效。
import { HomeIndicator } from '@capgo/capacitor-home-indicator';
await HomeIndicator.hide();show
显示显示 iOS 屏幕底部的主屏幕指示器。
这会恢复 iOS 主屏幕指示器的默认可见性,使其始终对用户可见。这是默认行为。
仅限 iOS。对 Android 或 web 无效。
import { HomeIndicator } from '@capgo/capacitor-home-indicator';
await HomeIndicator.show();isHidden
标题:isHidden检查当前是否隐藏了主屏幕指示器。
返回 iOS 主屏幕指示器当前可见状态。
import { HomeIndicator } from '@capgo/capacitor-home-indicator';
const { hidden } = await HomeIndicator.isHidden();if (hidden) { console.log('Home indicator is hidden');} else { console.log('Home indicator is visible');}真实数据来源
标题:真实数据来源本页面由插件的 src/definitions.ts重新同步公共 API 时,重新运行同步。
继续从 Getting Started
标题:继续从 Getting Started如果您正在使用 入门 来规划仪表板和API操作,连接它与 使用@capgo/capacitor-home-indicator 为native能力在使用@capgo/capacitor-home-indicator API概述 为API概述的实现细节 介绍 为介绍的实现细节 API密钥 为API密钥的实现细节,并且 设备 为设备的实现细节。