Reputation: 2537
Is there a way to hide clock(time) from UIStatusBar?StatusBar without clock
Upvotes: 0
Views: 148
Reputation: 14068
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.
Upvotes: 0
Reputation: 57040
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.
Upvotes: 0