UITabBarController 像照片应用程序一样用动画隐藏显示栏

发布于 2024-08-18 07:39:31 字数 399 浏览 1 评论 0原文

我在使用 UITabBarController 时遇到了真正的麻烦。我有一个简单的照片应用程序,我正在尝试模拟与 Iphone 中的 PhotoApp 几乎相同的行为 主视图控制器是选项卡栏本身,我还有一个导航栏和顶部的状态栏。

我想要的是点击隐藏栏(不是使用计时器,只是点击)。 照片实际上是一个 UIScroll 视图,可以缩放照片或使其再次变为 1:1。这部分已经可以工作了,

在将视图推送到导航栏之前我已经尝试过设置 hidesBottomBarWhenPushed 并且它可以工作,但是我无法设置自定义动画,这不是真正的问题,我无法再次显示栏,它们消失了,我不知道如何重新显示它们,我确信我可能错过了一些非常明显的东西,但由于我在 obj C 方面的经验几乎没有半年的兼职时间,我想我在这里问的是 stackoverflow似乎得到了答案:)

i'm having a real trouble with UITabBarController. I have a simple foto app, and I'm trying to simulate almost the same behaviour as the PhotoApp from the Iphone
the main view controler is the tabbar itself, i also have a NavBar and a status bar on top.

What i want is on tap to hide the bars (not with timer, just on tap).
The photo is actually an UIScroll view that zooms the photo or makes it again 1:1. that part already works,

I've tried before pushing the view to the navbar to set the hidesBottomBarWhenPushed and well it works, but i can't set a custom animation, and that's not the real problem , I can't show again the bars, they dissapear and i don't know how to reshow them, i'm sure i'm probably missing someting very obvious, but as my experience in obj C is little like half a year part time, i thought i asked here as stackoverflow seems to get the answers :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长不大的小祸害 2024-08-25 07:39:31

需要调查的内容:Three20 项目:http://github.com/facebook/ Three20 - 它包括组件形式的照片浏览应用程序的完全克隆。

但如果没有 Three20,您就无法使用普通的 UINavigationController 来执行此操作,因为您使用的 UIViewControllerUINavigationController 的子视图。您需要在另一层上创建同级视图。为此,请创建一个父 UIViewController,它有两个子视图:您的照片和 UIToolbar。您可以通过设置 UIToolbar 的 hidden 属性来隐藏和显示 UIToolbar,并使用 [parent.view BringSubviewToFront:toolbarController] 确保它位于照片视图上方(其中 parent 是包含照片视图和 UIToolbar 的主 UIViewController)

Something to investigate: the Three20 project: http://github.com/facebook/three20 - it includes a completely clone of the photo-browsing app in component form.

But without Three20, you can't do this with a stock UINavigationController, because the UIViewController that you're using is a subview of the UINavigationController. You need to make a sibling view on another layer. To do this, make a parent UIViewController which has two subviews: your photo, and a UIToolbar. You can hide and display the UIToolbar by setting it's hidden property, and make sure it's above the photo view with [parent.view bringSubviewToFront:toolbarController] (where parent is the main UIViewController that contains both the photo view and the UIToolbar)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文