跳过内容

开始使用

GitHub

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

Install":"安装"
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

You can use our AI-Assisted Setup to install the plugin. Add the __CAPGO_KEEP_0__ skills to your AI tool using the following command:":"使用我们的AI辅助安装程序安装插件。将以下命令添加到您的AI工具中:"

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-navigation-bar` plugin in my project.

Copy to clipboard":"复制到剪贴板"

Then use the following prompt:":"然后使用以下提示:"
bun add @capgo/capacitor-navigation-bar
bunx cap sync

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:":"如果您prefer手动安装,请运行以下命令并遵循以下平台特定的说明:"

Terminal window":"终端窗口"
import { NavigationBar } from '@capgo/capacitor-navigation-bar';

设置导航栏颜色和按钮主题。

import { NavigationBar } from '@capgo/capacitor-navigation-bar';
// Set to white with dark buttons
await NavigationBar.setNavigationBarColor({
color: NavigationBarColor.WHITE,
darkButtons: true
});
// Set to custom color
await NavigationBar.setNavigationBarColor({
color: '#FF5733',
darkButtons: false
});
// Set a custom divider color on Android 9+
await NavigationBar.setNavigationBarColor({
color: NavigationBarColor.WHITE,
darkButtons: true,
dividerColor: '#D9D9D9'
});

获取当前导航栏颜色和按钮主题。

import { NavigationBar } from '@capgo/capacitor-navigation-bar';
const { color, darkButtons } = await NavigationBar.getNavigationBarColor();
console.log('Current color:', color);
console.log('Using dark buttons:', darkButtons);

预定义导航栏颜色。

export enum NavigationBarColor {
/** White color */
WHITE = '#FFFFFF',
/** Black color */
BLACK = '#000000',
/** Transparent color */
TRANSPARENT = 'transparent',
}

真实数据来源

真实数据来源

该页面是从插件生成的。 src/definitions.ts当公共API上游发生变化时,请重新运行同步。

从Getting Started继续

从Getting Started继续

如果您正在使用 Getting Started 规划原生媒体和界面行为,连接它到 使用@capgo/capacitor-导航栏 使用@capgo/capacitor-导航栏的原生功能 使用@capgo/capacitor-实时活动 使用@capgo/capacitor-实时活动的原生功能 @capgo/capacitor-实时活动 在@capgo/capacitor-实时活动中实现的细节 使用@capgo/capacitor-视频播放器 使用@capgo/capacitor-视频播放器的原生功能 @capgo/capacitor-视频播放器 在@capgo/capacitor-视频播放器中实现的细节