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开发者_如何学JAVA solution to this problem.
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.
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.
精彩评论