问题标签 [retina-display]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1951 浏览

iphone - 如何更新 2D iPhone 游戏以兼容 iPhone 4 的视网膜显示器?

更新现有的基于 OpenGL ES 1.1 的 2D iPhone 游戏以兼容 iPhone 4 的视网膜显示器的必要步骤是什么?我仍在使用带有 Apple 的CrashLanding(下载)示例代码的 Texture2D 类。

在阅读了Apple 的文档、观看了 WWDC 视频(第 134 期“针对 Retina 显示器优化您的 iPhone 应用程序”),以及查看Cocos2D示例代码之后,我仍然感到困惑。

我相信所需的步骤包括:

  • 将高分辨率艺术品(附加“@2x”)传递给[UIImage imageNamed:@"image.png"]
  • 将“contentScaleFactor”从 1.0 更改为 2.0(在哪里?)
  • 更新参数以glOrthof包含 contentScaleFactor
  • 调整大小glViewport

请注意,我对 OpenGL 比较陌生。

谢谢你的帮助!

0 投票
1 回答
1510 浏览

iphone - iPhone 4 640x960

可能重复:
如何区分 iphone4 和 iphone 3

好吧,我知道所有@2x 的东西,并且已经阅读了关于视网膜显示和高分辨率支持的其他 stackoverflow 线程和苹果参考资料,但无济于事。

我正在从支持分辨率请求参数的远程服务器加载图像。对于 iPhone4,我想请求更大分辨率的图像。

如何测试我是否在 iPhone 4 上?

在 UIDevice 上使用“模型”字段不是一个选项,因为我在模拟器中没有得到正确的值。

0 投票
3 回答
1067 浏览

iphone - “Retina Display”会影响开发者吗?

作为 iPhone 应用程序开发人员,我应该采取一些步骤(尤其是图形)使它们在 iPhone 4“Retina Display”上正确显示还是不存在这样的问题?

感谢您的帮助和时间。

0 投票
11 回答
9894 浏览

iphone - 没有为标签栏项目拾取高分辨率@2x 图像

我有一个 TabBarController 像这样设置选项卡的图像,在-init方法中:

self.tabBarItem.image = [UIImage imageNamed:@"tabImage.png"];

我在资源中有一个 tabImage@2x.png 文件。在 iPhone 4 模拟器或手机中,高分辨率图像没有被拾取 - 低分辨率版本只是被放大。

任何想法为什么会这样?

编辑:更多信息:如果我尝试明确使用tabImage@2x.png(或只是tabImage@2x),那么我看到的选项卡图像非常大并且超出了选项卡的范围,就好像它从 60 像素缩放到 120 像素一样。因此,看起来供应的任何名称都被视为 scale=1.0 图像。

0 投票
9 回答
17494 浏览

iphone - Retina icons (@2x) aren't being used when images are specified in code

I place a play.png image onto my view. When the view initially loads, the iPhone 4 grabs the corresponding play@2x.png file and it looks great. However, when I tap the play button my code swaps it out for the pause.png file. Then, when I tap the pause.png to bring back the play.png it uses the original play.png file (not the @2x version like I thought it would automatically reference).

This is the code I tried to use:

So, if I swap files after the initial view load, do I have to manually specify the @2x version inside an IF statement? If so, is the UIScreen.scale the best attribute to use for this?

I'm currently using code like this:

It's working fine but having the IF statement in there is annoying and seems a little fragile.

Thanks in advance to all you smarties out there.

0 投票
1 回答
1309 浏览

iphone - iPhone 4 的高分辨率 UI 元素(标签栏按钮...)

在哪里可以找到标准 iPhone UI 元素的高分辨率版本(如 UITabBarContacts.png)。我在某些网站上发现了低分辨率版本的图标。我需要它们,因为我想为 iPhone 4 升级我的应用程序。

谢谢!

0 投票
14 回答
99122 浏览

ios - 检测视网膜显示

iOS SDK 是否提供了一种简单的方法来检查 currentDevice 是否具有高分辨率显示器(视网膜)?

我现在发现的最好方法是:

0 投票
5 回答
400 浏览

iphone - 是提供新的艺术作品还是缩小大图像来处理 Retina 显示器更好?

iPhone 4 上令人惊叹的显示屏使我们能够制作更高分辨率的艺术品以利用新屏幕。

我的问题是,应用图像的更好方法是什么?目前,有两种方法可以做到这一点:

  • 使用两个图像:“image.png”和“image@2x.png”。这样做的问题是,如果您的应用程序需要大量图像,则捆绑包的大小会大大增加。此外,您必须缩放图像并正确保存它们,这可能需要相当长的时间。

  • 缩放图像。您只加载大图像,然后在代码中或使用 Interface Builder 将其缩放到 50%。这减少了包大小和设计时间,但在小屏幕上可能看起来不太好。

你认为哪种方法最好,为什么?

0 投票
2 回答
938 浏览

iphone - iPhone 4 应用程序在 iPad 上自动扩展?

我以为我读过/看到/听到过一些话,说为 iPhone 4 的 Retina 显示屏构建的应用程序在安装到 iPad 上时会自动以 640x960 运行。但是,找不到有关该特定功能的任何文档,并且我的应用程序安装在 iPad 上时仍以 320x480 运行。

我是否错过了实现这一目标的步骤?还是我只是想象这是一个功能?

0 投票
1 回答
1710 浏览

iphone - iphone如何将我的应用程序转换为视网膜显示应用程序

如何将我当前的应用程序转换为视网膜显示应用程序,并且我必须确保相同的应用程序也可以在 iphone 3 中运行。如果只是将我的图像更新为高分辨率,它也可以在 iphone 3 中使用。那么“视网膜显示”应用程序将没有任何意义。