I am working on a landscape iPhone app. It runs fine on the iPhone but when I run it on an iPad or the iPad simulator it has problems dealing with touches that exceed 320 in the x direction.
A lot of the UIButtons beyond 320 will highlight when pressed but won't do their action.
When I add this to my superviews:
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
CGPoint touchLocation = [touch locationInView:self];
NSLog(@"bounds: %1.2f %1.2f touch: %1.2f %1.2f",self.bounds.size.width,self.bounds.size.height,touchLocation.x,touchLocation.y);
}
it will never output an x value greater than 320. Any part of the screen pressed that is greater than 320 gives an output of 320 for x.
The UIViews are all done programatically and without UIViewControllers. I have set the plist to start it in landscape and in the applicationDidFinishLaunching I rotate the views with this:
window.transform = CGAffineTransformMakeRotation((M_PI / 2.0));
window.bounds = CGRectMake(0, 0, 480, 320);
window.center = CGPointMake(160.0f, 240.0f);
[window makeKeyAndVisible];
Any help is appreciated.