Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the status bar color gradually

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?

like image 802
Tiago Almeida Avatar asked Nov 11 '22 08:11

Tiago Almeida


1 Answers

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.

like image 85
Edgar Avatar answered Nov 15 '22 05:11

Edgar