是否可以隐藏带有动画的UIToolbar? [英] Is it possible to hide a UIToolbar with an animation?

查看:51
本文介绍了是否可以隐藏带有动画的UIToolbar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道此代码仅适用于UINavigationController.

I know this code is available to UINavigationController only.

[self.navigationController setNavigationBarHidden:YES animated:YES];

推荐答案

使用块的示例.这将在iPad屏幕顶部隐藏工具栏.

An example using blocks. This will hide a toolbar at the top of an iPad screen.

[UIView animateWithDuration:.7 
                 animations:^(void)
                 {
                     CGRect toolbarFrame = self.toolbar.frame;
                     toolbarFrame.origin.y = -44; // moves iPad Toolbar off screen
                     self.toolbar.frame = toolbarFrame;
                 } 
                 completion:^(BOOL finished)
                 {
                     self.toolbar.hidden = YES;
                 }];

这篇关于是否可以隐藏带有动画的UIToolbar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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