隐藏/显示NavigationBar&工具栏点按 [英] Hide/Show NavigationBar & Toolbar on tap

查看:125
本文介绍了隐藏/显示NavigationBar&工具栏点按的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试隐藏我的navigationBar和工具栏,类似于Photos应用程序的工作方式。

I'm trying to hide my navigationBar and toolbars on tap, similar to the way the Photos application works.

任何指针都会非常感激。

Any pointers would be greatly appreciated.

谢谢!

推荐答案

尝试为UINavigationBar的y值设置动画和UIToolBar一样

Try to animate the y value of UINavigationBar and UIToolBar like this

[UIView beginAnimations: nil context:NULL];
[UIView setAnimationDuration:0.4];
[UIView setAnimationDelegate: self];
CGRect rect = self.navigationController.navigationBar.frame;
rect.origin.y = -40;
self.navigationController.navigationBar.frame = rect;
[UIView commitAnimations];

希望这对你也有帮助。

A。

这篇关于隐藏/显示NavigationBar&工具栏点按的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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