开始
复制一个包含安装步骤和此插件的完整 Markdown 指南的设置提示。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-navigation-bar`
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/navigation-bar/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-navigation-bar` plugin in my project.如果您prefer手动设置,请按照以下命令安装插件并遵循以下平台特定说明:
bun add @capgo/capacitor-navigation-barbunx cap sync导入
导入import { NavigationBar } from '@capgo/capacitor-navigation-bar';API概述
API概述setNavigationBarColor
设置导航栏颜色和按钮主题获取当前导航栏颜色和按钮主题
import { NavigationBar, NavigationBarColor } from '@capgo/capacitor-navigation-bar';
// Set to white with dark buttonsawait NavigationBar.setNavigationBarColor({ color: NavigationBarColor.WHITE, darkButtons: true});
// Set to custom colorawait NavigationBar.setNavigationBarColor({ color: '#FF5733', darkButtons: false});
// Set a custom divider color on Android 9+await NavigationBar.setNavigationBarColor({ color: NavigationBarColor.WHITE, darkButtons: true, dividerColor: '#D9D9D9'});getNavigationBarColor
导入导入
import { NavigationBar } from '@capgo/capacitor-navigation-bar';
const { color, darkButtons } = await NavigationBar.getNavigationBarColor();console.log('Current color:', color);console.log('Using dark buttons:', darkButtons);类型参考
类型参考标题NavigationBarColor
导航栏颜色预定义导航栏颜色
export enum NavigationBarColor { /** White color */ WHITE = '#FFFFFF', /** Black color */ BLACK = '#000000', /** Transparent color */ TRANSPARENT = 'transparent',}context: Capgo营销网站. 角色: UI标签. 见于: 页面代理/[slug].astro. 消息键 `agents_page_copy_label` (代理页面复制标签).
真实来源真实来源标题 src/definitions.ts当公共API上游发生变化时,请重新运行同步。
重新同步公共 __CAPGO_KEEP_0__ 时,源代码发生变化.
继续从开始继续从开始标题:如果您正在使用 开始使用 为原生媒体和界面行为规划,连接它 使用@capgo/capacitor-导航栏 为原生能力在使用@capgo/capacitor-导航栏 使用@capgo/capacitor-直播活动 为原生能力在使用@capgo/capacitor-直播活动 @capgo/capacitor-直播活动 为@capgo/capacitor-直播活动实现细节 使用@capgo/capacitor-视频播放器 为原生能力在使用@capgo/capacitor-视频播放器,并且 @capgo/capacitor-视频播放器 为@capgo/capacitor-视频播放器实现细节