Dimensions of my screen are 317x470, not 320x480

Discussion in 'iOS Programming' started by 99miles, Mar 14, 2009.

  1. 99miles macrumors member

    Oct 10, 2008
    I've been having a problem with an app I'm creating where the touch hittests on my screen are not consistent on the top and bottom of the screen.

    Say I have 2 copies of the same UIView, one towards the top and one towards the bottom of the screen. When I go to touch the view on the top of the screen the hittest returns true when the touch is much lower on that view than when I do the same check on the view towards the bottom of the screen.

    I've been trying to figure this out for a long while now, and I just realized that when I log my touch points all over the screen the highest y point i get is 470, and the highest x point i get is 317. Has anyone ever noticed anything like this? The screen should be 320x480, and I'm guessing that's what's messing up my hittests.
  2. firewood macrumors 604

    Jul 29, 2003
    Silicon Valley
    Are your measurements on the Simulator or on a device? I wonder how accurately the touch digitizer is calibrated on a device or between devices?
  3. 99miles thread starter macrumors member

    Oct 10, 2008
    The measurements are from the device. The same tests on the simulator give me the expected dimensions, 320x480.

    And all the hittests work perfectly in the simulator, but not on the phone (in the way that I described in the first post).

    So weird.

Share This Page