Is there a way to hide clock(time) from UIStatusBar?StatusBar without clock
3 Answers
Not possible with public API. It is possible to fake it, but it is likely you will get banned for modifying a behavior that the user is accustomed to.
If you are feeling adventurous, you can create a UIWindow
with the size of the clock, set its background to the color of the background, set its level to UIWindowLevelStatusBar + 1
and display it. It will be on top of the status bar, hiding the status bar clock.

- 56,823
- 9
- 150
- 195
-
i have a question regarding UIWindowLevelStatusBar and rotation. can you please take a look http://stackoverflow.com/questions/26976494/ios-8-7-uiwindow-with-uiwindowlevelstatusbar-rotation-issue – Hashmat Khalil Nov 18 '14 at 07:44
Access the UIWindow. You should get it from the AppDelegate. Acesss its subviews and find the Status bar. Within the status bar's subviews identify the clock. Then add a solid white subview to the clock using the clock's bounds as frame.
Frankly, I never did that myself but accessed the network indicator, which follows pretty much the same logic just without adding a subview.
I would not remove the clock view element. Alternatively I might try hiding it or assigning alpha=0 or so.

- 14,039
- 5
- 48
- 71
-
-
This answer is not correct. The status bar is not housed in the main application window; it sits in a different window, which cannot be accessed normally using public API (e.g. `[UIApplication sharedApplication].windows` does not return this status bar window). – Léo Natan Apr 15 '14 at 16:17
-
Well, it is some time ago that I tried it so far as accessing the network status indicator. Unless there was a change in iOS7, it should work. However, Danil sais that the clock will stay ontop. – Hermann Klecker Apr 15 '14 at 16:30