在通话状态栏中进行iPhone编程 [英] iPhone Programming In Call Status Bar

查看:91
本文介绍了在通话状态栏中进行iPhone编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在通话情况下测试我的应用程序时,状态栏会按下我的视图或应用程序。反正有状态栏挂在我的视图上。这个问题的最常见解决方案是什么。

When I test my application on an in call situation, the status bar push down my view or app. Is there anyway to have the status bar hang over my view. What is the most common solution to this problem.

推荐答案

当出现通话状态栏时,应用程序的窗口会调整其直接状态子视图的框架:他们的frame.size.height减少了20分,他们的frame.origin.y变大了20分。通常,窗口的唯一直接子视图是您的根视图。因此,根视图为通话中状态栏产生空间,并且无法阻止此行为。从技术上讲,你不能让状态栏挂在你的其他视图。

When the in-call status bar appears, your application's window adjusts its direct subviews' frames: their frame.size.height becomes 20 points less, and their frame.origin.y becomes 20 points larger. Typically, your window's only direct subview is your root view. So the root view "yields" space for the in-call status bar, and there is no way of preventing this behavior. Technically speaking, you can not have the status bar 'hang over' your other views.

但是,你可以让状态栏看起来像挂在你的应用程序上,通常这可以很容易地完成。您所要做的只是调整根视图的所有直接子视图的自动调整行为,因此它们具有固定的底部边距和固定的内容高度,但具有灵活的上边距。您可以在Interface Builder中或以编程方式执行此操作。

However, you could make the status bar 'look' like hanging over your application, and typically this could be done easily. All you have to do is just to tweak the autoresizing behaviors of all direct subviews of the root view, so they have a fixed bottom margin and a fixed content height, but a flexible top margin. You can do this either in Interface Builder or programmatically.

然而,这可能有副作用,当您希望它们在自动调整情境中的行为方式不同于通话状态栏。

However, this may have side effects, when you want them to behave differently in autoresizing situations other than having the in-call status bar.

您永远不能让通话状态栏保持半透明状态,以便用户可以通过状态栏查看应用程序的内容。

And you can never make the in-call status bar translucent so the user can see the content of your application through the status bar.

这篇关于在通话状态栏中进行iPhone编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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