Example
The showcase
app uses it in 2 places:
-
In the root
_layout.tsx
to set the navigation bar color upon app load: see the code -
In the
ThemeToggle
component to set the navigation bar color when the theme is changed: see the code
component. -->
expo-navigation-bar
A function to set the android navigation bar’s content color based on the theme.
Install expo-navigation-bar dependencies
Copy/paste the following code to ~/lib/android-navigation-bar.tsx
:
Whenever you set the color scheme, call the function to update the navigation bar
Example
The showcase
app uses it in 2 places:
In the root _layout.tsx
to set the navigation bar color upon app load:
see the code
In the ThemeToggle
component to set the navigation bar color when the theme is changed: see the code