Snapchat更新状态栏iOS7更新 [英] Snapchat update status bar iOS7 update

查看:187
本文介绍了Snapchat更新状态栏iOS7更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在最新的更新snapchat,当你向右滑动消息状态栏会由黑色变为白色在一种渐变时尚。

On the latest snapchat update, when you "swipe right for messages" the status bar turns from black to white in a sort of gradient fashion.

http://imgur.com/osJI20u

他们是如何做这个而不使用私有API的,或正在使用私有API的吗?

How are they doing this without using private API's, or are they using private API's?

我已经研究过:

乍一看,我还以为他们只是在做其他人一样,(像RDIO目前还)通过屏幕捕捉整个屏幕,然后修改/动画的截图。

At first glance, I thought they are just doing what everyone else does, (like rdio currently does) by screen capturing the whole screen, and then modifying/animating that screenshot.

不过......你不能访问或动画从屏幕上的UIImage捕获方法,所以虽然你可以移动/作物的截图,你不能改变它的外观。

But... you cant access or animate the UIImage from that screen captures method, so although you could move/crop that screenshot, you cannot change its look.

所以...我测试过,并在状态栏处于该状态(半黑/半白),它仍然生活在它不是一个截图,并响应变化的充电/信号的变化等,据我可以告诉这是不可能不使用私有API。

So... I tested it, and when the status bar is in that state (half black/half white), it is still LIVE as in its not a screenshot, and it responds to charging changes/signal changes etc, as far as I can tell this is impossible without using a private API.

推荐答案

这让我好奇,所以我的应用起到了一下,使用越狱设备上星火督察检查应用程序的视图层次,我发现了一些东西

This got me curious so I played with the app a bit and inspected the view hierarchy of the app using Spark Inspector on a jailbroken device and I found a few things.

您是不正确的关于他们不使用的屏幕截图。你是从导航AWAY侧面的状态栏快照并不会改变。你可以很容易地看到这种一分钟的推移,您正在过渡到将有改变视图中的新的状态栏,因为它是真实的,但旧的不会因为它是一个快照。这使得幻觉容易锻炼。

You are incorrect about them not using a screenshot. The status bar on the side you are navigating AWAY from is a snapshot and does not change. You can easily see this when a minute goes by, the new status bar for the view you are transitioning into will have changed because it is real but the old one will not because it is a snapshot. That makes the illusion easy to work out.

下面是什么,是在较高的水平发生了什么:

Here is what is happening at a high level:


  1. 在开始转换时,应用程序需要在状态栏的快照(最有可能它实际上正在整个 UIScreen 快照,只是裁剪在其当前状态的状态栏了它),并附加包含快照过渡的视图的顶部,挂靠到最后过渡位置和从视图控制器的观点掩盖的窗口。显示该窗口有一个 windowLevel 上方 UIWindowLevelStatusBar 所以它能够覆盖真正的状态栏。

  1. When you begin the transition, the app takes a snapshot of the status bar(most likely it is actually taking a snapshot of the entire UIScreen and simply cropping the status bar out of it) in its current state and attaches a window containing that snapshot to the top of the view in the transition, anchored to the final transition position and masked by the "from" view controller's view. This window appears to have a windowLevel above UIWindowLevelStatusBar so it is able to cover the real status bar.

于是,到视图控制器接管的实际状态栏,并将其更改为轻量状态。这presents聪明的幻想,一个状态栏颜色变化与过渡边界,但真正的状态栏始终居然坐在快照窗口下方,确实是可见的转换开始时立即如果不是的快照窗口坐在它上面。

Then, the "to" view controller takes over the actual status bar and changes it to the "light content" state. This presents the clever illusion that a single status bar changes color with the transition border, but the real status bar is actually always sitting below the snapshot window and would indeed be visible immediately when the transitions begins if it weren't for the snapshot window sitting on top of it.

这篇关于Snapchat更新状态栏iOS7更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆