简体   繁体   中英

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

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.

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.

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?

It's a bug in the Simulator. It's working fine on iPhone. Check http://gtekna.com/?p=140

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM