Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing the status bar in my app

Tags:

iphone

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 ?

like image 967
José Joel. Avatar asked Nov 05 '22 19:11

José Joel.


2 Answers

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.

like image 117
Tim Avatar answered Nov 15 '22 12:11

Tim


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?

like image 21
Jesse Beder Avatar answered Nov 15 '22 12:11

Jesse Beder