PDA

View Full Version : touch events on statusbar




thevibesman
Dec 24, 2008, 01:27 AM
Is it possible to detect touch events on the status bar like the double-tap action in safari? The best lead I got from googling was that the object for the statusbar is private so maybe not legit to use. My attempts to expand views into the status bar area so far haven't worked. Any ideas?



jouni
Dec 24, 2008, 01:39 AM
I was wondering this recently too. Either there are some notifications for it, or then maybe you could get around it somehow. I noticed that if you have UITextView on your view, the statusbar is detected as a tap/scroll to the begining of the view. Add UITextView and detect it's scroll..? just small workaround and should be "App Store" safe if you think it as just using published UITextView API.

thevibesman
Dec 24, 2008, 02:08 AM
I read about that UITextView solution, but that won't work for me. I am hoping to get touch location information so I can split the status bar up into 3 or 4 sections to make multiple hidden buttons out of the status bar.

TuffLuffJimmy
Dec 24, 2008, 02:10 AM
I'm no programmer, but wouldn't it be possible to just make invisible buttons that are right next to the status bar? Since the status bar is so small the user would hit the buttons anyway.

thevibesman
Dec 24, 2008, 02:52 AM
Basically, I'm designing some apps that need every pixel of space available on the screen for tracking touches (the multiple buttons on the status bar is just one example). I don't want to hide the status bar because I'd still like to show the cell, WiFi, and battery status to the user but without sacrificing any of my possible touch areas. Since I am not trying to emulate existing statusbar touch uses, faking it in any way really won't do the trick for me because I really would like to have specific UITouches delivered when the user touches those top 20 pixels.

Pim
Dec 29, 2008, 07:23 AM
I thought it was an automatic event for any scrollview, but that doesn't appear to be the case. I'm going to look into this.

liptonlover
Dec 29, 2008, 08:37 AM
Apple allows access to all the information in the status bar, so you could hide the status bar, simulate it by redrawing everything yourself as separate items, then put your invisible buttons there. That way you could customize the status bar to fit the theme of your app too if you want.

thevibesman
Dec 30, 2008, 12:03 AM
Apple allows access to all the information in the status bar, so you could hide the status bar, simulate it by redrawing everything yourself as separate items, then put your invisible buttons there. That way you could customize the status bar to fit the theme of your app too if you want.


Really? That would be ideal because then I wouldn't need to waste space with the status bar at all and could just show battery/connectivity (no need for time and perhaps I could even streamline those graphics more.

I couldn't find anything in the documentation related to this, care to point out which class reference I need to check out?

liptonlover
Dec 30, 2008, 12:18 AM
I think I mis-worded what I said, I made it a tad too definite. I have seen apps that tell you the time, and others with wifi data. But I haven't looked for(or seen) any official classes. Sorry if I ended up misleading you. They may be there, but I haven't seen them myself.

thevibesman
Dec 30, 2008, 01:40 AM
The phone obviously has functions/methods to call to get this info to display it in the status bar, but from searching around it seems like Apple doesn't allow it (i.e. private APIs) from everything I've read on the developer site.

I too have seen apps that can tell WiFi network strength and battery status (time doesn't really count, that is easy is every software environment I've ever dealt with) and am a little confused by this because all official word seems to say this isn't supported. I found some references to private frameworks on code.google.com to help with WiFi related info. So what do you guys think, are these WiFi/battery status apps breaking rules in the use of private APIs and somehow Apple didn't notice during the approval process or do you think there is some undocumented work around that Apple considers legit yet unsupported? I'd really like to be able to handle battery, WiFi, and cell info in my own way in some of my apps but am a little nervous about wasting much more time pursuing a solution to have Apple tell me I can't do it when I submit my app.

liptonlover
Dec 30, 2008, 09:17 AM
I don't think apple will mind as long as the overall scheme is within limits. A way to possibly be safer, however, is to simply duplicate exactly one of the existing styles except for of course the buttons.

thevibesman
Dec 30, 2008, 09:59 AM
Look and feel is not the issue. As far as I can figure out the only way to get this information is via private APIs which as I understand would be a violation of the SDK agreement and not be allowed on the store. So it is a question of code, not interface, but are the applications that are accessing WiFi/cell/battery info somehow getting under Apple's radar re: the use of private APIs, or is there a legit way to CODE this.