iPhone Programming In Call Status Bar

和自甴很熟 提交于 2019-12-13 05:36:44

问题


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.


回答1:


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.

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.




回答2:


This is expected behavior in iOS. I don't think there is any way to get around this, and if there is, I'm sure apple would not be happy about your app attempting to get around it.



来源:https://stackoverflow.com/questions/4987605/iphone-programming-in-call-status-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!