0

Is there a way to hide clock(time) from UIStatusBar?StatusBar without clock

Danil
  • 2,497
  • 2
  • 19
  • 27

3 Answers3

3

No this is not possible in the current iOS SDK.

rckoenes
  • 69,092
  • 8
  • 134
  • 166
0

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.

Léo Natan
  • 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
0

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.

Hermann Klecker
  • 14,039
  • 5
  • 48
  • 71
  • I tried this approach but the clock is always on top. – Danil Apr 15 '14 at 15:57
  • 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