Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jsnuff1

macrumors 6502a
Original poster
Oct 4, 2003
730
340
NY
How would I go about decting whether my App is launched while a user is on a phone call? Right now my whole view is shifted down by the green bar on top while on a call, so a bottom portion of my view is blocked off.

I can reconfigure my view correctly if I know when a user is on a call, but I cant seem to find a way to know that.
 
Me Too

Instead of creating a new thread for my question, I actually searched first for an answer... I could not find the answer, but found the question.

I would also like to be able to determine if a phone call is in progress or not. I'd like to be able to be in a phone call and then start and use my app. However, if I am currently in a phone call I have to set up my view differently, so I figured I'd resurrect this old post.

Does anyone know if it's possible to determine if that green 'phone-call-bar' is currently displayed or not?

Thanks
 
Thanks robbieduncan. I do have the auto-resizing stuff set up correctly so my view will scale when it gets resized.

I have another issue, though. I have a bunch of elements in specific locations in my app and I handle the touches myself by looking at the touch and comparing it to where I know my element is on the screen. When my view auto-resizes, the element is no longer where is 'should be', so my touch-detecting code does not work correclty.

Not sure if this makes sense or not, but if anyone has any ideas I'm open to suggestions!

Thanks.
 
Thanks robbieduncan. I do have the auto-resizing stuff set up correctly so my view will scale when it gets resized.

I have another issue, though. I have a bunch of elements in specific locations in my app and I handle the touches myself by looking at the touch and comparing it to where I know my element is on the screen. When my view auto-resizes, the element is no longer where is 'should be', so my touch-detecting code does not work correclty.

Not sure if this makes sense or not, but if anyone has any ideas I'm open to suggestions!

Thanks.

You should not be assuming the position: read it from the element at the time of the touch.
 
@robbieduncan - I was not quite clear in my last post. The elements I was talking about really aren't elements/objects at all - I simply draw them using CoreGraphics in my view's drawRect method, so they don't know where they are located at. And, actually, if I don't do the scaling stuff (UIViewContentModeScaleAspectFit) they will still be located in the 'correct' spot relative to my view, but I still have the issue of needing to draw my view differently when a phone-call is in session.

I realize now that it's pretty simple... I call

Code:
[self setContentMode:UIViewContentModeRedraw];

on my view so the view will get re-drawn if it resizes, and then in my drawRect method of my view I can get the size of the status bar using

Code:
[[UIApplication sharedApplication] statusBarFrame];

The height is 40 when the status bar is in the 'green-phone-call-mode'. When the caller hangs up my view will get resized, and hence redrawn thanks to the method above, and now when I get the size of the status bar it is the 20 pixels as normal and I can draw my view accordingly.

Thanks for the comments, though. It made me realize I was going about this the wrong way and got me back on track!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.