Advertise here

Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

No touch events on hidden StatusBar place

YzaYza Posts: 5New Users
edited April 2010 in iOS SDK Development
Hi there!

Im playing arround SDK couple of weeks but I still have a problem with recognizing touch on whole screen size. I wanna make fullscreen app - so i call in my applicationDidFinishLaunching the lines for getting rid of the StatusBar and setting the UIWindow, UIView etc. (for assuring the UIView size I manually create myRect variable)
- (void)applicationDidFinishLaunching:(UIApplication *)application {	
	[application setStatusBarHidden:YES animated:NO];

	CGRect myRect=CGRectMake(0.0,0.0,320.0,480.0);
	window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
	mainView = [[MainView alloc] initWithFrame:myRect]; 
	[window addSubview:mainView];
        [window makeKeyAndVisible];


and now the problem - after all this ... I cant touch the place where the StatusBar was (rect from position 0,0 with height 20 pix and width 320 px).

my touchesBegan func inside the mainView
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 
	UITouch *touch = [[event allTouches] anyObject];
	CGPoint location = [touch locationInView:self];
	NSLog(@"loc %f, %f",location.x,location.y);

if is the location.y<20.0 it just dont work.
Any ideas ? I saw some apps which obiously dont have problem with this. I spent a lot of hours on google to fix it but without result.

Thank you in advance!
Post edited by Yza on


  • ScubaScuba Posts: 208Registered Users
    edited August 2008
    Bump... having the same issue here.
  • cpatchcpatch Posts: 79Registered Users
    edited August 2008
    You guys aren't alone...there are several threads discussing the same problem here and over on the Apple boards. They've been there since the SDK was in beta. I have yet to see a solution.
    <a href=""; target="_blank">Streamtree Studios</a><br />
    <a href=""; target="_blank">XyPhone</a> (App Store link)
  • mxweasmxweas Posts: 142Registered Users
    edited August 2008
    You need to make the frame of your window/view after the status bar is gone. 0.0f,0.0f is just below the status bar when its there. So, removing the status bar won't change already drawn/initialized views. But if you make a view or change a view's frame after the status bar has been removed 0.0f, 0.0f will exist on a different part of the screen :)

  • scottyelichscottyelich Posts: 79Registered Users
    edited August 2008
    I did this:

    app make status bar disappear...
    viewcontroller.view.frame = 0,0,320,480
    window addsubview viewcontroller.view

    my old frame for the view was 0,0,320,480 .. do I have to change it to
    something else? (ie: does it check to see if the bounds are the same and
    then just return.. let me check) nope... even when I changed the frame
    to 10,10,50,50 and then to 0,0,320,480 .. still 20 dead pixels.

  • peterjpeterj Posts: 83Registered Users
    edited March 2009

    I am having the same problem.
    Does anyone has the solution for this problem?

  • IphonicaIphonica Posts: 16Registered Users
    edited July 2009
    we're having the same problem.
    Did anyone find a solution for that?

    we're using cocos2d and working on the simulator.
    Is it only a simulator bug? or do we have "dead pixels" area?

    appreciate your help

  • unowenunowen Posts: 10Registered Users
    edited August 2009
  • mongoose250mongoose250 Posts: 27Registered Users
    edited September 2009
    It's a REAL conundrum! Apple gives you two methods for removing the StatusBar but provides no way to sense touch events in the 20 pixel vacancy. Thanks for listening and responding Apple!
  • BrianSlickBrianSlick Treadmill Desk Ninja Posts: 10,692Tutorial Authors, Registered Users @ @ @ @ @ @ @ @
    edited September 2009
    Cocoa with Love: Intercepting status bar touches on the iPhone

    Edit: nevermind. Misunderstood the issue.
    Professional iOS App Development. Available for hire.
    BriTer Ideas LLC - WWW | Facebook | Twitter | LinkedIn

    BTIKit | SlickShopper 2 | Leave a PayPal donation
  • dbyersdbyers Posts: 6New Users
    edited December 2009
    has anyone been able to find a workaround for this? i'm working on a UI that replaces the status bar with a custom toolbar.

    it's so much faster to test in the simulator. guess the only workaround would be to lower the frame 20px for just simulator use.

    please apple, help us out here.
  • OMHOMH Posts: 18Registered Users *
    edited January 2010
    I don't get any touch events when y<20, even when I'm on the device.
    I tried various suggestions from forums, but still no change.
    It's a full screen OpenGL app.

    Can anyone explain this?
  • festivalfestival Posts: 44Registered Users @
    edited April 2010
    OMH wrote: »
    I don't get any touch events when y<20, even when I'm on the device.
    I tried various suggestions from forums, but still no change.
    It's a full screen OpenGL app.

    Can anyone explain this?

    as far as i found's a bug in the iphone-simulator

    the device recognizes the area if the status bar is gone
Sign In or Register to comment.