How to hide status bar in ios13 in cocos-2dx

How to hide status bar in ios13 in cocos-2dx

Hi everyone,

I was using:


in info.plist file to hide status bar for ios. Also in my is

    - (BOOL)prefersStatusBarHidden 
       return YES;

to fix hiding status bar on ios7. Everything worked fine untill I tried this code on ios13. At ios13 status bar does not hide anymore. Does anybody know how to hide status bar for ios13?
I also tried to add


but nothing seemed to work.

this works for me… you also need to go to project->General->Status Bar Style
set it to requires fullscreen and hidestatus bar

Hi, Ive got the same problem. Ive checked the project->general->Status Bar Style and I already have checkboxes
requires fullscreen and hidestatus bar checked.

@VBilokin @whoami23041990 what devices did you test on? Can i use cpp-empty-test to reproduce it?

It works for me as well.

device is iphone XR

I tried this issue on pure 3.17.1 cocos-2dx demo project. The apps layout covers all screen, so status bar is not visible.

I tried to compare parametrs - [[UIScreen mainScreen] bounds].size.width and [[UIScreen mainScreen] bounds].size.height in in both projects, and I`ve got the following results:
My prjoject: width 320, height 568,
Demo project: width 812, height 375.

I guess something is wrong with screen width and height, but I did not find how to change them, maybe because I am new to ios development

Finally, I found the reason for that.
my project was missing launchscreen storyboard.
Adding launchscreen storyboard and hiding safe area and setting launch screen file in general settings allowed to hide status bar.

1 Like