Richtlinie
Tutorial in der Navigationsleiste
Mit @capgo/capacitor-Navigation-Bar
Capacitor Navigation Bar Plugin für die Anpassung des Android-Navigationsleisten.
Installieren
bun add @capgo/capacitor-navigation-bar
bunx cap sync
Was dieses Plugin bereitstellt
setNavigationBarColor- Die Farbe und das Design der Navigationsleiste und der Schaltfläche setzen.getNavigationBarColor- Die aktuelle Farbe und das Design der Navigationsleiste und der Schaltfläche abrufen.
Beispielverwendung
setNavigationBarColor
Die Farbe und das Design der Navigationsleiste und der Schaltfläche setzen.
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'
});
getNavigationBarColor
Die aktuelle Farbe und das Design der Navigationsleiste und der Schaltfläche 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);
Vollständige Referenz
- GitHub: https://github.com/Cap-go/capacitor-navigation-bar/
- Dokumentation: /docs/plugins/navigation-bar/
Weitermachen Sie mit der Verwendung von @capgo/capacitor-navigation-bar
Wenn Sie die Verwendung von Mit der Verwendung von @capgo/capacitor-navigation-bar um native Medien und Schnittstellenverhalten zu planen, verbinden Sie es mit @capgo/capacitor-navigation-bar für die Implementierungsdetails in @capgo/capacitor-navigation-bar Einstieg für die Implementierungsdetails in Einstieg Mit der Verwendung von @capgo/capacitor-live-activities für die native Fähigkeit in Verwendung von @capgo/capacitor-live-aktivitäten @capgo/capacitor-live-aktivitäten für die Implementierungsdetail in @capgo/capacitor-live-aktivitäten und Verwendung von @capgo/capacitor-video-player für die native Fähigkeit in Verwendung von @capgo/capacitor-video-player.