I am making a simple app using Unity and I would like to display the status bar. I enabled to show it in the player setting for Android as I am currently testing Android only.
However when testing the app, some of the icons disappear. And I would like for it to be the same as always, specially for icons showing your connection status for WiFi and 3G service.
View when not running my app:
View when running my app:
When I swipe down the status bar, the icons appear again, but when I swipe it back up (while still being in my app), the fade out again.
Any ideas on how to let the status bar show all icons as normal?
I was not focused on the issue for some time but I did some new research today and I have found some answers. So I’ll just answer it here to potentially help others stumbling upon this
First of, this is caused by passing the flag
to setSystemUiVisibility(int) on Android, on Android API 11 and above.
Since Unity 4, this is set when full screen regardless of you enabling or disabling the status bar
Unity docs: Screen.SetResolution
So The fix I did for now was just setting the resolution on Android passing false for fullscreen. It looks exactly the same but Unity internally doesn’t set that flag to the Android UI system, leaving all icons visible.
Code I used:
Screen.SetResolution(Screen.width, Screen.height, false);
I also found the following link to call that Android function manually with own flags if you want, but I didn’t try that myself:
Unity forums: calling setSystemUiVisibility from Unity
Hope this helps someone out there