简体   繁体   中英

When I create an iphone window based app, how to tell interface builder create window for retina pixel size?

I hope to create an iphone window based app for retina screen? But I found that the size of window in mainwindow.xib is fixed. How to adjust it or there is any to tell interface builder create window for retina pixel size?

Welcome any comment

Thanks

interdev

There's no need to do anything in terms of the various components you layout in Interface Builder, as it's based around points, not pixels - and as all the iPhone screens sizes are the same in points no action is required.

In terms of any images you're loading, you will need to supply higher resolution (twice the pixel size) versions, but as long as these are named "[original name]@2x.[extension]" they'll simply work automatically.

For more information on the image naming, see the "Specifying High-Resolution Images in iOS" section of the Resource Programming Guide and if you want to delve a little deeper, there's a discussion on "Points Versus Pixels" within the Drawing and Printing Guide for iOS .

UPDATE - As of the iPhone 5, the iPhone screens are no longer all the same point size. :-)

The window will be automatically resized for you, you do need concern about the size of your image elements, since retina display uses a bigger size of resolution. You need name your images like this:

regular image name: myimage.png
retina image name:  myimage@2x.png

When running in an iPhone4 your program will identify the token "@2x" and change the images for that kind of device.

Design your layout using the size of: 640x960 (double of the original: 320x480)

Good luck.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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