iPhone 应用程序更改 willChangeStatusBarFrame 上的视图并暂停
在我的应用程序中,我有一个 UINavigationController 和一个以编程方式创建的 UINavigationBar。 UINavigationBar 在视图中具有自定义定位,但每当调用 will/didChangeStatusBarFrame 时(当您启用通话中状态栏时),或者应用程序暂停和恢复时,navBar 都会自动移回屏幕顶部。
我可以通过将导航栏保持在底部来稍微覆盖此行为,但现在它创建了第二个导航栏,并将其移动到顶部。
为什么会发生这种情况,我该如何防止这种情况发生?这是 iOS 4 的一个新问题 - 该应用程序在 2.x 和 3.x 中都运行良好。
另外,在开始讨论人机界面指南之前,请注意,我知道 Apple 不希望 UINavigationBars 位于底部。然而,这是一个自定义应用程序,将由我和我一个人使用,我要求该栏位于底部。此外,这个问题让我抓狂,无论我的导航栏位于何处,我都想知道答案......
In my application, I have a UINavigationController with a UINavigationBar that I created programmatically. The UINavigationBar has custom positioning within the view, but whenever will/didChangeStatusBarFrame is called (when you enable the in-call status bar), or the app suspends and resumes, the navBar automagically moves back to the top of the screen.
I was able to override this behavior somewhat by keeping my navBar in place at the bottom, but now it creates a SECOND navBar which it moves to the top.
Why is this happening, and how do I prevent it from happening? This is a new issue with iOS 4 - the app ran fine in both 2.x and 3.x.
Also, before a discussion about Human Interface Guidelines is started, please note that I'm aware Apple doesn't want UINavigationBars at the bottom. However, this is a custom app that will be used by me and me alone, and I require that the bar be at the bottom. Additionally, this issue is driving me nuts and I want to know the answer no matter where my navBar lies...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
哎呀,这有点像黑客,但它确实有效。
要在显示通话状态时将导航栏保持在底部:
并且由于使用此应用程序进行多任务处理不仅是不必要的,而且也是不需要的,因此我通过将以下内容添加到 plist 来禁用它:
这仍然没有真正回答我的问题关于为什么导航栏跳到顶部,这是一个黑客修复,但它现在必须工作。
Whelp, this is a bit of a hack, but it works.
To keep the navBar at the bottom when the in-call status is displayed:
And since multitasking with this app is not only unnecessary but also unwanted, I disabled it by adding the following to the plist:
This still doesn't really answer my question about why the navBar was jumping to the top, and it's a hackish fix, but it will have to work for now.