我有一个适用于目标设备 iPad Air 的现有 iOS 应用程序,我希望它在 iPad PRO 上运行。一切正常,但我需要一个图像在两个设备上保持相同的尺寸(mm 上的 realSize)。
两个设备的分辨率相等,所以我不明白为什么 iPad Pro 上的图像更大。这就是我绘制图像的方式。
- (void) drawNewNumberImage {
int index = arc4random()%_allNumbers.count;
while([_currentNumber isEqualToString:[_allNumbers objectAtIndex:index]]) {
index = arc4random()%_allNumbers.count;
}
_currentNumber = [_allNumbers objectAtIndex:index];
int s = _size;
//_imgView.image = [UIImage imageNamed:[_allNumbers objectAtIndex:index]];
_imgView.image = [ImageProvider getPDFVectorImage:[_allNumbers objectAtIndex:index] AndFontSize:s];
CGRect frame = _imgView.frame;
frame.size = CGSizeMake(s, s);
_imgView.frame = frame;
_imgView.center = CGPointMake(CGRectGetWidth(self.view.frame)/2 , CGRectGetHeight(self.contentView.frame)/2);
}
iPad Pro 似乎只是扩展了所有应用程序。有没有办法禁用此行为。
最佳答案
如果您针对 iOS 8 SDK 进行构建,那么您需要添加一个大小合适的启动图像。否则 Apple 会假设您不知道如何在 iPad Pro 中处理并扩大一切。检查您的代码从何处获取屏幕大小并 NSLog ;如果您得到 1024 x 768,那么您就错过了正确的启动图像。
顺便说一句。你应该真的,真的不看屏幕的高度或宽度并做出假设,就像另一个答案所做的那样,因为在 iPad Pro 上使用分屏你的假设可能非常非常错误并让你进入麻烦。
关于ios - 在 iPad Pro 上放大的 iPad Air App,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37924376/