【发布时间】:2012-02-20 20:40:39
【问题描述】:
为了测试非/视网膜显示,我创建了一个尺寸为 100x100 的 UIView。
我创建了 2 张图片: - 正常尺寸(100x100) - 视网膜尺寸 (200x200)
我有两种情况: 1) 非 Retina 显示 + 背景中的正常尺寸图像 2) Retina display + Retina Size 图片在背景中
第一种情况没问题。 在第二种情况下,图像是双倍大小,在我的 UIView 中,我只能看到总图像的 1/4。
当我尝试将背景图像分配给我的 UIViewController 导航栏时,也会发生同样的情况:
if (IS_RETINA()) {
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:IMG_NAVIGATION_BAR_BACKGROUND_RETINA] forBarMetrics:UIBarMetricsDefault];
}
else {
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:IMG_NAVIGATION_BAR_BACKGROUND] forBarMetrics:UIBarMetricsDefault];
}
【问题讨论】:
标签: iphone ios retina-display