在 iOS 7 中移动状态栏 [英] Moving status bar in iOS 7

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

问题描述

我面临的问题是:

我想实现一个具有漂亮设计和左/右菜单的 iOS 7 应用程序,它出现在主视图向右/向左移动之后.我用 [UIView animateWithDuration...] 代码来做这件事,但这并不重要.我想要实现的是 Mailbox 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-快照视图:

这样你就会得到一个 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屋!

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