iOS 5.1 与 Xcode 4.2 和 iPad 3 中的视网膜

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9611596/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 17:13:03  来源:igfitidea点击:

iOS 5.1 with Xcode 4.2 and retina in iPad 3

iosxcodeipadretina-display

提问by Red Mak

i have a Mac with Mac OS X Snow Leopard, can i add iOS 5.1 to it?

我有一台装有 Mac OS X Snow Leopard 的 Mac,我可以向它添加 iOS 5.1 吗?

With the new resolution for iPad 3, how we will do with images, because if the app will run in iPhone 3GS, 4 and iPad 3 i think we should have 3 images with different name like @3x.png or .. thank you.

使用 iPad 3 的新分辨率,我们将如何处理图像,因为如果应用程序将在 iPhone 3GS、4 和 iPad 3 中运行,我认为我们应该有 3 个不同名称的图像,例如@3x.png 或 .. 谢谢。

采纳答案by WrightsCS

iOS 5.1 comes with Xcode 4.3.1 which is only available for Lion —?the only download available in the Developer section on Apple's Developer portal for iOS 5.1.

iOS 5.1 随附 Xcode 4.3.1,它仅适用于 Lion — 这是 Apple 的 iOS 5.1 开发人员门户的开发人员部分中唯一提供的下载。

Basically, the iPad images are going to be double the size of the image you would normally create for the iPad. For instance:

基本上,iPad 图像将是您通常为 iPad 创建的图像大小的两倍。例如:

Launch images

iPhone:: 320 x 480

iPhone @2x:640 x 960

iPad:768 x 1004 (portrait), 1024 x 748 (landscape)

iPad @2x:1536 x 2008 (portrait), 2048 x 1496 (landscape)

启动映像

iPhone:: 320 x 480

iPhone @2x:640 x 960

iPad:768 x 1004(纵向)、1024 x 748(横向)

iPad @2x:1536 x 2008(纵向)、2048 x 1496(横向)

Per Apple

每苹果

Get your app ready for the new iPad.

To ensure your iOS 5 apps are optimized for the new iPad, review the updated iOS Human Interface Guidelines and iOS App Programming Guide.

为新 iPad 准备好您的应用程序。

为确保您的 iOS 5 应用程序针对新 iPad 进行了优化,请查看更新的 iOS 人机界面指南和 iOS 应用程序编程指南。

iOS SDK Release Notes for iOS 5.1

适用于 iOS 5.1 的 iOS SDK 发行说明

With this software you can develop applications that run on iPhone, iPad, or iPod touch running iOS 5.1. You can also test your applications using the included iOS Simulator, which supports iOS 5.1. iOS SDK 5.1 requires a Macintosh computer running OS X 10.7 (Lion).

使用此软件,您可以开发在运行 iOS 5.1 的 iPhone、iPad 或 iPod touch 上运行的应用程序。您还可以使用随附的 iOS 模拟器测试您的应用程序,该模拟器支持 iOS 5.1。iOS SDK 5.1 需要运行 OS X 10.7 (Lion) 的 Macintosh 计算机。

Naming Scheme:

命名方案:

This seems to be the naming scheme for the new retina graphics for the new iPad.

这似乎是新 iPad 的新视网膜图形的命名方案。

icon@2x~iphone.png; icon@2x~ipad.png

icon@2x~iphone.png; icon@2x~ipad.png

回答by Dan Rosenstark

@WrightCS's answer handles the part about the images perfectly well.

@WrightCS 的回答完美地处理了有关图像的部分。

However, you canget the simulator and SDK to run on Snow Leopard.

但是,您可以让模拟器和 SDK 在 Snow Leopard 上运行。

  1. Download Xcode version 4.3.1 bypassing the AppStore from here http://developer.apple.com/downloads
  2. Open up the package and copy

    /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Develop??er/SDKs/iPhoneOS5.1.sdk
    to 
    /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
    
  3. Copy

    /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceS??upport/5.1
    to
    /Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1 (9B176
    
  4. Copy

    /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/??Developer/SDKs/iPhoneSimulator5.1.sdk
    to 
    /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1??.sdk
    
  1. 从这里下载 Xcode 4.3.1 版绕过 AppStore http://developer.apple.com/downloads
  2. 打开包装并复制

    /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Develop??er/SDKs/iPhoneOS5.1.sdk
    to 
    /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
    
  3. 复制

    /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceS??upport/5.1
    to
    /Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1 (9B176
    
  4. 复制

    /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/??Developer/SDKs/iPhoneSimulator5.1.sdk
    to 
    /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1??.sdk
    

Adapted from here.

这里改编。

Edit:Get your iPad Retina on by copying

编辑:通过复制让你的 iPad Retina

/Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app
to
/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app`

回答by Kay R?pke

You will probably also want to copy the 5.1 docset to be able to view the most recent documentation within Xcode:

您可能还想复制 5.1 文档集以便能够在 Xcode 中查看最新的文档:

Copy

复制

/Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiOS5_1.iOSLibrary.docset
to
/Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiOS5_1.iOSLibrary.docset                      

And be sure to restart Xcode.

并确保重新启动Xcode。

回答by cynistersix

You will need 4 resolutions most likely for some items and 2 for others.

对于某些项目,您很可能需要 4 个分辨率,而对于其他项目则需要 2 个分辨率。

1- iPhone 2- iPhone Retina (@2x.png files)

1- iPhone 2- iPhone Retina(@2x.png 文件)

You only need these if you're scaling up the resolution if the old graphic for retina iPhone works you probably want to use that for your iPad UI. Specifics like app icons are a different beast and you will need 4.

如果 Retina iPhone 的旧图形可以工作,您只需要在放大分辨率时才需要这些,您可能希望将其用于 iPad UI。应用程序图标之类的细节是不同的野兽,您将需要 4。

3- iPad 4- iPad Retina (@2x.png files)

3- iPad 4- iPad Retina(@2x.png 文件)