Can't Detect CGPoint:locationInView At Status Bar?

Discussion in 'iOS Programming' started by Darkroom, Jun 5, 2009.

  1. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #1
    i can't seen to receive the CGPoint coordinates within the first 20 pixels of the Y coordinate, where the status bar should be.

    i've used UIStatusBarHidden:YES in the property list, and have selected "none" for status bar of the window and resized the view, but it's just not registering. it's as if the status bar is still there, albeit hidden, and not allowing core graphics to access that space.

    i've attached the project. click and drag to the top of the screen and you'll see the Y coordinate will stop at 21, as well as not give any feedback if clicking within the top space.

    is this normal?

    is there no explanation for this? perhaps an oversights on my part?
     

    Attached Files:

  2. BlackWolf macrumors regular

    Joined:
    Apr 9, 2009
    #2
    what's the size of your UIWindow? is it 320 by 480?
     
  3. Darkroom thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #3
    window is 480, view was 460 but even with changing the view to 480 i still receive no response when dragging up to the first 20 pixels of the display (which is usually reserved for the status bar).

    seems to be a tricky one. unexpected behavior for UIStatusBarHidden:YES.
     
  4. BlackWolf macrumors regular

    Joined:
    Apr 9, 2009
    #4
    I'm currently not on my mac so I can't test the project you uploaded, I will test it tomorrow though.

    did you ever try putting a UILabel or something at 0,0 on your ViewController's view and see if it is drawn correctly? because I still think if your view would work correctly than the touches should as well
     
  5. Darkroom thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #5
    the UIView and UILabels appear within this space fine. the space just isn't responding to touch methods.

    it's very strange.
     
  6. xsmasher macrumors regular

    xsmasher

    Joined:
    Jul 18, 2008
    #6
    You can't seem to detect touches in the area where the status bar used to be? That's a bug in the simulator; should work like a champ in on the actual device.
     
  7. Darkroom thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #7
    humm, i never though of that possibility. unfortunately i don't yet have access to test my code on my device. would be great if someone with access could test it using the attached code above to see if that's truly the reasoning behind this mystery.
     
  8. mackiethemacmac macrumors newbie

    Joined:
    Jun 9, 2009
    #8
    Same Problem On Device

    I am having the exact same problem with one of my projects, and i first discovered it on the device, so it's not a simulator issue. I would really like to get a fix for this.
     
  9. Darkroom thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #9
    changing the app delegate's applicationDidFinishLaunching method to the following doesn't seem to fix the error

    Code:
    [COLOR="DarkGreen"]//from this[/COLOR]
    [window addSubview:viewController.view];
    
    [COLOR="DarkGreen"]//to this[/COLOR]
    [window insertSubview:viewController.view atIndex:0];
    
    and neither did adding another view to host the view controller's view (touch view):
    Code:
    - (void)applicationDidFinishLaunching:(UIApplication *)application
    	{    
    	CGRect aFrame = [[UIScreen mainScreen] bounds];
    	UIView *aView = [[UIView alloc] initWithFrame:aFrame];
    	baseView = aView;
    		
    	[window addSubview:baseView];
    	[aView release];
    
    	[baseView addSubview:viewController.view];
    	[window makeKeyAndVisible];
    	}
    
    under normal situations it wouldn't have made any difference, but since this seems to be a bug i gave it a shot. unfortunately, the mystery continues.
     
  10. mackiethemacmac macrumors newbie

    Joined:
    Jun 9, 2009
    #10
  11. mackiethemacmac macrumors newbie

    Joined:
    Jun 9, 2009
    #11
    Wrong

    ^^^That post addressed something different^^^^^.

    Just to clarify this is NOT a simulator issue - confirmed!

    I have seen apps that recieve these touches. These apps may have used OpenGL which may fix the prob.

    Will anyone who knows the answer kindly share? I gave up on this bug months ago.
     
  12. drf1229 macrumors regular

    drf1229

    Joined:
    Jun 22, 2009
    #12
  13. mackiethemacmac macrumors newbie

    Joined:
    Jun 9, 2009
    #13
    ^^^^^ nice try but....

    Before I gave up on this I tried the above link: Nice info, I learned some stuff but ultimately apple will not accept apps that subclass uiapplication! It would apear as if there is some other means of achieving this goal.
     

Share This Page