简体   繁体   English

如何在Xcode 5 iOS7中使我的iPad应用程序视网膜

[英]How can I make my iPad apps retina in Xcode 5 iOS7

Not long ago I started learning Objective-C with an interest of developing apps. 不久前,我对开发应用程序感兴趣,开始学习Objective-C。 I have just started my first app and I have no clue how to make my app retina. 我刚启动我的第一个应用程序,却不知道如何使我的应用程序视网膜。 I made the design in photoshop and exported it as a png @ 2,048 x 1,536 but however the size of my storyboard is only 1,024 x 768. I have read somewhere on the internet that you need two story boards but I am not sure how to link everything together. 我在photoshop中进行了设计,并将其导出为png @ 2,048 x 1,536,但是我的情节提要的大小仅为1,024 x768。我在互联网上读过某个地方,您需要两个情节提要,但是我不确定如何链接一切都在一起。 I would really appreciate it if someone could help me. 如果有人可以帮助我,我将不胜感激。

No we don't need two storyboards for this. 不,我们不需要两个故事板。 In storyboard, the view size will be 1024 x 768. You have to design the views for same sizes and keep images for these sizes only. 在情节提要中,视图大小将为1024 x768。您必须将视图设计为相同大小,并仅保留这些大小的图像。 Example, if you are making an UIImageView of size 100 x 100, then you will need to set its image of size 100 x 100 only. 例如,如果要制作大小为100 x 100的UIImageView,则只需设置其图像大小为100 x 100。 Now the extra effort required is: If you named that image as test.png of size 100 x 100, then you have to add same image with name test@2x.png and size 200 x 200 to your project folder. 现在所需的额外工作是:如果您将该图像命名为大小为100 x 100的test.png,则必须将名称为test@2x.png且大小为200 x 200的相同图像添加到项目文件夹。

Now when the application will run on non retina divice, then it will by default take test.png and when the app will run on retina device, then test@2x.png will be used. 现在,当应用程序将在非视网膜设备上运行时,默认情况下它将采用test.png;当应用程序将在视网膜设备上运行时,将使用test@2x.png。 This is default property you don't need to set this any where in code. 这是默认属性,您无需在代码中的任何位置设置此属性。

So make your views as usual and just keep images with @2x.png in project folder. 因此,请像平常一样显示您的视图,并在项目文件夹中保留@ 2x.png图像。 Rest things will be managed automatically. 休息的事情将被自动管理。

What is Retina Display 什么是视网膜显示

@1X is a resolution (or rather, a process) in which many designers still design apps. @ 1X是一种分辨率(或更确切地说是一个过程),许多设计师仍在其中设计应用程序。 Why? 为什么? Because (and as many would have to agree) designing at such is much more tangible. 因为(并且需要许多人同意)以这种方式进行设计更为实际。 I find it hard to explain why it's so, but all I can say is that the content feels much more 1 on 1, it feels right so to speak, and the design is much more flexible to deal with, because of our “low” resolution computer displays that we're designing them on. 我很难解释为什么会这样,但是我只能说内容在一对一的感觉上要多得多,可以说是正确的,而且由于我们的“低价”,设计的处理更加灵活。我们正在设计的高分辨率计算机显示器。 Though that doesn't mean we all like designing @1X. 虽然这并不意味着我们都喜欢设计@ 1X。 I've seen many others who build wonderful, beautiful apps designing at both processes (the other would have to be @2X — resolution of that of the Retina Display) and some say it feels much more comfortable for them having to have their content match perfectly without having to scale things up and tweak things around on the display. 我见过很多其他人在这两个过程中都设计出了精美,漂亮的应用程序(另一个必须为@ 2X,即Retina Display的分辨率),并且有些人说,让他们必须将内容匹配起来会更舒服完全无需放大和调整显示器上的内容。

More Dtails 2x-the-retina-dilemma 更多Dtails 2x视网膜困境

How identify the retina display 如何识别视网膜显示

#define IS_RETINA_DISPLAY ([[UIScreen mainScreen] respondsToSelector:@selector(displayLinkWithTarget:selector:)] && ([UIScreen mainScreen].scale == 2.0))

if(IS_RETINA_DISPLAY)
{
   // RETINA_DISPLAY 
}else{
  // NON_RETINA_DISPLAY 
}

Now, that the iPad has been released, I'm sure you are all scrambling for ideas on how to snag a piece of the market in the imminent gold rush. 现在,iPad已经发布,我敢肯定,大家都在争相寻求在即将到来的淘金热中如何抢占市场份额的想法。 some of below links is going to help you on your journey with a series of iPad tutorials to come. 以下一些链接将为您提供一系列iPad教程,助您一路顺风。

ipad-programming-tutorial-hello-world ipad编程教程你好世界

How-To-Develop-iPad-Apps 如何开发iPad应用程序

please follow bellow tutorial for iOS.It's a first step towards the iOS. 请按照iOS的波纹管教程进行操作。这是向iOS迈出的第一步。 http://mobile.tutsplus.com/ http://www.raywenderlich.com http://mobile.tutsplus.com/ http://www.raywenderlich.com

I am new to iOS development too. 我也是iOS开发的新手。 This link has been a huge help on questions related to this. 该链接对与此相关的问题提供了极大的帮助。 https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/App-RelatedResources/App-RelatedResources.html https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/App-RelatedResources/App-RelatedResources.html

You can pull up the same thing in the Xcode documentation by searching "app-related". 您可以通过搜索“与应用程序相关”来在Xcode文档中找到相同的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM