如何输入/输出状态栏和导航栏同时滑动? [英] How to slide in/out statusBar and navigationBar simultaneously?

查看:114
本文介绍了如何输入/输出状态栏和导航栏同时滑动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示和隐藏状态栏和导航栏同时使用幻灯片的效果。

I'd like to show and hide the statusBar and the navigationBar simultaneously using a slide effect.

这是我怎样努力:

[[UIApplication sharedApplication] setStatusBarHidden:hide withAnimation:UIStatusBarAnimationSlide];
[self.navigationController setNavigationBarHidden:hide animated:animated];

但是,这两个动画的持续时间是不一样的。状态栏动画需要更长的时间。
我发现没有办法如何指定或者动画的持续时间。
我错过了一些东西明显?

However, the duration of both animation is not the same. The status bar animation takes longer. I found no way how to specify the duration of either animation. Did I miss something obvious?

推荐答案

显然,有没有简单的解决办法做到这一点的权利。苹果已经修复

Clearly, there's no easy solution to do this right. Apple has to fix it.

当然,人们的解决办法是使用阿尔法衰落莲建议。如果你在滑动行为坚持,我发现它最好还是动画导航栏隐藏/显示状态栏没有任何动画。这看起来比滑动状态栏,因为在动画过程中横杠之间的差距是相当明显好多了。

Of course, one work-around is to use alpha fading as Ephraim suggests. If you're insisting on the sliding behavior, I found it best to just animate the navigation bar and hide/show the statusBar without any animation. This looks much better than sliding the status bar because the gap between the bars during the animation is quite noticeable.

这篇关于如何输入/输出状态栏和导航栏同时滑动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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