Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to make the Android Navigation Bar transparent in Expo

I'm working on a React Native project with expo and am trying to have the Android Navigation bar rest on top of my view (as shown below and described here)

transparent navigation bar

However I am having difficulty getting my desired result instead I get a gray bar at the bottom.

unsuccessful transparent navigation bar

Thus far I've tried to set the navigation bar to transparent in my app.json file or use NavigationBar.setBackgroundColorAsync(color) both ending with the same result.

//app.json
    "androidNavigationBar": {
      "backgroundColor":"#00000000"
    },
//App.js
    //also tried flex: 1
    <View style={{height: Dimensions.get("screen").height, backgroundColor: "blue"}}></View>
like image 833
David Choi Avatar asked Sep 17 '25 13:09

David Choi


1 Answers

try using expo-navigation-bar

import * as NavigationBar from "expo-navigation-bar";

NavigationBar.setPositionAsync("absolute");
NavigationBar.setBackgroundColorAsync("#ffffff01");
like image 84
holyluck Avatar answered Sep 19 '25 04:09

holyluck