Open Moemen02 opened 1 year ago
hi @Moemen02 , I'm working on it.
hi @Moemen02, Can you try refer this code.
<Dropdown
onFocus={() => {
setIsFocus(true);
StatusBar.setBarStyle('light-content');
}}
/>
Hi @hoaphantn7604, thanks for the response! When I try doing that I am getting this error: TypeError: _expoStatusBar.StatusBar.setBarStyle is not a function. (In '_expoStatusBar.StatusBar.setBarStyle('light')', '_expoStatusBar.StatusBar.setBarStyle' is undefined)
. I tried looking it up and I did not find any solutions for this error.
But I found a another solution for the changing color of the statusbar, I had to add this in the app.json
:
"androidStatusBar": {
"barStyle": "light-content"
},
With the code above me the statusbar does not change, but I have another problem. As you can see in the second picuture of my original post I have a navigationbar. Right under there you can see the android "swipe up gesture thing" on some devices you see a "go back", "previos app" etc icons. That bar stays white when I toggle the menu.
I've tried the following things to prevent it becomming white:
I've added this to the app.json
(did not work):
"androidNavigationBar": {
"barStyle" : "light-content",
"backgroundColor": "black"
},
And I have tried adding the following code to the dropdown:
import * as NavigationBar from 'expo-navigation-bar';
<Dropdown
onFocus={() => {
setIsFocus(true);
NavigationBar.setBackgroundColorAsync(colors.navBar);
NavigationBar.setBorderColorAsync("transparent");
}}
/>
The code above sets the navigation bars color only after te dropdown is deselected. What I mean by that is when I for example when I set the color to red when it's focused, it wont change to red. It will only change after I deselect/subtract my dropdown
I am having same issue in android using bare react native. Need solution for this ASAP.
Same problem here
No fix yet?
Any update on this? It is happening the same also for Navigation Bar color at the bottom in Android.
So when I tap on my dropdown, my statusbar changes to it's default color on android. I do not know why it does that, could someone help me please? I have added some pictures so you guys know what I mean.
I have set my statusbar color in my app.js like this:
And my dropdown menu looks like this:
So as you can see in the images underneath, when I toggle my dropdown. The statusbar and the NavigationBar are resetting, how can I fix this?