移动iOS 7中的状态栏 [英] Moving status bar in iOS 7
问题描述
我面临的问题是:
我想实现一个设计精良且左/右菜单的iOS 7应用程序,它出现在主视图之后将自己动画到右侧/左侧。我正在使用 [UIView animateWithDuration ...]
代码执行此操作,但这并不重要。我想要实现的是与邮箱iOS 7应用程序相同的效果:使用主视图移动状态栏(向右/向左)
I want to implement an iOS 7 app with nice design and left/right menu, which appears after the main view animate itself to the right/left. I'm doing this with [UIView animateWithDuration...]
code, but that's not really important. What I want to achieve is the same effect the Mailbox iOS 7 app has: to move the status bar away (to the right/left) with the main view
更好的解释:
我唯一发现的是这篇关于这个问题的文章,一些使用私有API的工作代码,我不想使用,因为我希望我的应用程序在App Store上被接受。
What I only found is this article about the issue, with some working code using Private APIs, which I'd like not to use, since I want my app to be accepted on the App Store.
我想达到同样的效果('合法')。有谁知道怎么做?
I'd like to achieve the same effect ('legally'). Does anybody knows how to?
谢谢!
推荐答案
要点它是使用iOS 7中引入的这种方法:
The gist of it is to use this method introduced in iOS 7:
https://developer.apple.com/documentation/uikit/uiscreen/1617814-snapshotview :
有了这个你得到一个UIView,其中包含一个包含状态栏的屏幕截图。一旦你拥有了它,只需隐藏你当前的视图然后推动截屏视图。
With that you get a UIView containing a screenshot that includes the status bar. Once you have that, it's just a matter of hiding your current view then pushing the screenshot view around.
我在这里发布了一个概念验证:
https://github.com/simonholroyd/StatusBarTest
I posted a proof of concept here: https://github.com/simonholroyd/StatusBarTest
注意我还没有提交通过Apple审核流程执行此操作的代码,但这不是私有API方法。
NOTE I haven't submitted code that does this through the Apple review process, but this is not a private API method.
这篇关于移动iOS 7中的状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!