【发布时间】:2013-12-28 18:53:19
【问题描述】:
我在我的应用代码中简单地放置了一个 UILabel:
headerLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 5, 884, 68)];
headerLabel.font = [UIFont fontWithName:@"HoboStd" size:64];
headerLabel.textAlignment = UITextAlignmentCenter;
headerLabel.backgroundColor = [UIColor clearColor];
headerLabel.textColor = [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:1.0f];
headerLabel.adjustsFontSizeToFitWidth = YES;
[self.view addSubview:gameSpeaks];
在 iOS6 iPad 3 上,文本在屏幕上显示的位置比在 iOS 7 iPad Mini 上显示的稍高一些,代码相同,.xib 和所有内容都相同。有人知道这是 iOS6 还是 iOS7 的结果,还是设备不同或其他我不知道的问题?
我想要说当我在 iOS6 上测试 iPad Mini 时,它显示的文本位置与 iPad 3 相同,然后我将它升级到 iOS7 并注意到这种差异.如果是导致此问题的操作系统版本 - 在代码中测试操作系统版本的首选方法是什么,以便在 OS7 设备与 OS6 设备上运行时我可以根据需要重新定位标签?
非常感谢!
【问题讨论】: