tags:

views:

364

answers:

3

I'm making an small game for iPhone in openGL.

First I removed the "status bar" by writting

[[UIApplication sharedApplication] setStatusBarHidden:YES];

Which worked, but only removed the status bar when my app began to run. Then I modified my project.plist

<key>UIStatusBarHidden</key>
<true/>

And now the status bar is never show, just how I wanted. The problem is that I'm reading touches without problem in any portion of the screen, except for the zone where the status bar used to be.

// This method deals with events when one or more fingers touch the screen
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [myProject newTouch:touches withEvent:event]; 
    [self.nextResponder touchesEnded: touches withEvent:event];
}

// This method deals with events when one or more fingers moves while touching the screen
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    [myProject movingTouch:touches withEvent:event  ];
}

// This method deals with events when one or more fingers stops touching the screen
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    [myProject oldTouchEnded:touches withEvent:event  ];
}

// This method deals with events when the system is interrupted ( for example an incomming call)
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
    // 
}

I guess that hiding the bar is not enough and it must be removed, but how can I do it ?, or there Is another solution ?

A: 

What's the size of the view you're reading in? Sometimes people hide the status bar but forget to resize their view to cover the appropriate area. The complete screen is 320x480 - make sure your height is the full 480px, not 460 or smaller.

Tim
Yep, It's 320 X 480, but the problem persists.
José Joel.
+1  A: 

There is a bug in the simulator: it doesn't register touches where the status bar is (or would be). It works properly on the device, though.

Are you testing on the simulator or on the device?

Jesse Beder
The problem happens both in the device and the simulator.
José Joel.
A: 

Did anyone ever find a fix to this issue? I'm having the exact same problem with hiding the status bar and not registering touch events in the area where it used to be. A solution would be greatly appreciated.

bborhani