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 ?
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.
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With