Question

Changing the status bar's text color in iOS7 is simple and there is a lot of information on that topic.

So, to give you some context, today I saw this tweet:

enter image description here

That links to this video.

I was wondering about how to do that animation and the best way I can think of is:

A screenshot of the status bar with black text color that is inserted on top of the real status bar (with white color) and then the real status bar is slowly revealed.

As @Edgar confirmed it it is really what they are doing in the video (if you keep the finger on the screen while the time changes it is possible to see that).

However, this solution isn't good enough because in the meantime the status bar can change and it can become kinda creepy.

Is there a way to do this without a screenshot?

Was it helpful?

Solution

When you start swiping it does a screenshot of the status bar and puts it at the top of the real status bar and then it changes to style UIStatusBarStyleLightContent to UIStatusBarStyleDefault.

You can clearly see this if you play around with it and start the swipe gesture but do not release it, not only after one minute the clock becomes outdated but if you happen to start swiping when the activityIndicator is on, you'll see it stays static.

Unfortunately, as far as I know there's no way to have two status bars, both with the right info. Maybe if you could come up with a way to continually take screenshots of the real one and dynamically invert colors, but that would be expensive, performance wise.

OTHER TIPS

As i know the status bar color depends on the near by view attached to status bar.

if it is connected to the navigation bar then status bar takes the color of the navigation bar.

if navigation bar is hidden then the top view that near to the status bar that color is taken by the status bar.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top