仅在320x480区域中检测到iPad触摸 [英] iPad touch detected only in 320x480 region
问题描述
我正在升级iPhone应用程序,到目前为止一切顺利(管理为大多数形式调整屏幕显示大小)。然而,我不能解决一个问题 - 触摸只检测在旧的,320x480区域。任何想法如何解决这个问题?
I'm upgrading iPhone app and so far everything is going well (managed to resize screen display for most forms). However, I can't solve one problem - the touch is detected only in old, 320x480 region. Any ideas how can I solve that?
感谢
编辑: bounds执行:
Here are the results when code for fetching superview bounds executes:
CGFloat wdth = self.view.superview.bounds.size.width;
NSLog(@"%d", wdth);
CGFloat hgth = self.view.superview.bounds.size.height;
NSLog(@"%d", hgth);
结果:
2010-04-16 14:25:36.268 xxx[14871:207] 0
2010-04-16 14:25:36.269 xxx[14871:207] 1073741824
b $ b
(%f)的结果:
Result for (%f):
2010-04-16 14:37:26.048 xxx[15053:207] -1.998374
2010-04-16 14:37:26.049 xxx[15053:207] 0.000000
g):
2010-04-16 14:37:41.113 xxx[15084:207] -1.99837
2010-04-16 14:37:41.115 xxx[15084:207] 9.48221e-38
推荐答案
a href =http://iphonedevelopment.blogspot.com/2010/04/converting-iphone-apps-to-universal.html =nofollow noreferrer> http://iphonedevelopment.blogspot.com/2010/04 /converting-iphone-apps-to-universal.html
http://iphonedevelopment.blogspot.com/2010/04/converting-iphone-apps-to-universal.html
在您的AppDelegate:
In you AppDelegate:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// stupid Apple...
CGRect rect = [[UIScreen mainScreen] bounds];
[window setFrame:rect];
// now, display your app
[window addSubview:rootController.view];
[window makeKeyAndVisible];
}
这篇关于仅在320x480区域中检测到iPad触摸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!