Zum Inhalt springen

Getting Started

GitHub

Sie können unsere AI-gestützte Einrichtung verwenden, um das Plugin zu installieren. Fügen Sie den Capgo-Fähigkeiten Ihre AI-Werkzeug hinzufügen, indem Sie die folgende Befehl ausführen:

Terminal-Fenster
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Verwenden Sie dann die folgende Anfrage:

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

Wenn Sie die manuelle Einrichtung bevorzugen, installieren Sie das Plugin, indem Sie die folgenden Befehle ausführen und folgen Sie den unten angegebenen Plattform-spezifischen Anweisungen:

Terminal-Fenster
bun add @capgo/capacitor-navigation-bar
bunx cap sync
import { NavigationBar } from '@capgo/capacitor-navigation-bar';

Die Farbe der Navigationsleiste und des Schalters festlegen.

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'
});

Die aktuelle Farbe der Navigationsleiste und des Schalters abrufen.

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

Vordefinierte Navigationsleistenfarben

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

Diese Seite wird aus dem Plugin generiert. src/definitions.tsRe-run die Synchronisierung, wenn die öffentliche API upstream geändert wird.

Wenn Sie native Medien und Schnittstellenverhalten planen, Getting Started um es mit Mit @capgo/capacitor-Navigation-Leiste Für die native Fähigkeit in Mit @capgo/capacitor-Navigation-Leiste Mit @capgo/capacitor-Live-Aktivitäten Für die native Fähigkeit in Mit @capgo/capacitor-Live-Aktivitäten @capgo/capacitor-Live-Aktivitäten Für die Implementierungsdetails in @capgo/capacitor-Live-Aktivitäten Mit @capgo/capacitor-Video-Player Für die native Fähigkeit in Mit @capgo/capacitor-Video-Player und @capgo/capacitor-Video-Player Für die Implementierungsdetails in @capgo/capacitor-Video-Player.