Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Can I Get Touch Events in an iPhone App's Hidden Status Bar's Area?

Tags:

iphone

I have an iPhone app that hides the status bar. However, my main view doesn't get any touch events when I tap in the status bar area. Is there something I can do to fix this?

Here are a few details of my app's setup (in case it matters):

  • It's an OpenGL-based application.
  • The app launches in landscape mode. However, the touch events are missing when I tap in the area near the "top" of the portrait-mode area. (In other words, I don't get touch events on the left edge when I have the device held in landscape orientation.)
  • My info.plist has UIStatusBarHidden set true, and in my application delegate's applicationDidFinishLaunching method I have "application.statusBarHidden = YES;"
  • The main view has exclusiveTouch set to YES.
  • The view's touchesBegan:withEvent method is called when I tap anywhere else on the screen.
  • My view draws fine within the status-bar area.

(Please refrain from whining about the NDA. Thank you.)


Update: It turns out that this problem only manifests itself on the iPhone Simulator. When the app is run on an actual iPhone, touches are detected everywhere.

I'm still interested to know if there is a way to make it work on the Simulator, but it's no big deal.

like image 285
Kristopher Johnson Avatar asked Sep 28 '08 16:09

Kristopher Johnson


2 Answers

Found my own answer (of sorts):

This behavior only happens in the iPhone Simulator. When I run the application on an actual iPhone, it works fine.

I'd still be interested to know if there is a way to make it work on the simulator.

like image 94
Kristopher Johnson Avatar answered Sep 28 '22 06:09

Kristopher Johnson


I haven't had this problem, but then again, I'm not using OpenGL views. When you launch in Landscape mode, are you setting the StatusBarHidden property of the appropriate ViewController?

like image 38
Mark Bessey Avatar answered Sep 28 '22 05:09

Mark Bessey