iOS 7淡入淡出状态栏文本? [英] iOS 7 Fade status bar text in and out?

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

问题描述

我知道可以删除状态栏,但如果将状态栏设置为隐藏状态,框架会向上移动状态栏的高度。因此,以下代码:

I know it's possible to remove a status bar, however the frame shifts up by the height of the status bar if you set it to hidden. As such, the following code:

[UIApplication sharedApplication].statusBarHidden = YES;

仅用于隐藏状态栏的文本。我最终尝试在这里完成的工作与Gmail应用程序类似,在显示侧边菜单时,状态栏文本被隐藏,然后一旦选择,框架将恢复正常状态栏文本显示。

is not sufficient for just hiding the text of the status bar. What I'm ultimately attempting to accomplish here is something similar to the Gmail app in which as the side-menu is displayed, the status bar text is hidden, and then once a selection is made the frame returns to normal with the status bar text displayed.

此问题显示如何为状态栏的隐藏设置动画,但结果是整个窗口向上移动状态栏的高度。我试图避免这种情况发生。

This question shows how to animate the hiding of the status bar but the result is that the entire window shifts up by the height of the status bar. I'm trying to avoid that from happening.

推荐答案

Objective-C版本:

Objective-C version:

[AppDelegate instance].window.windowLevel = UIWindowLevelStatusBar;

Swift版本:

AppDelegate().window!.windowLevel = UIWindowLevelStatusBar

这篇关于iOS 7淡入淡出状态栏文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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