Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

99miles

macrumors member
Original poster
Oct 10, 2008
50
0
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.
Anyone?
Thanks!
 

firewood

macrumors G3
Jul 29, 2003
8,108
1,345
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?
 

99miles

macrumors member
Original poster
Oct 10, 2008
50
0
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.