Missing Retina 4 launch image(Supporting the iPhone 5)
来源:互联网 发布:mysql选择数据库指令 编辑:程序博客网 时间:2024/05/23 12:53
Update: A Russian translation available at osxdev.ru here
iPhone 5 is out and it poses a new challenge to developers, a bigger screen. iOS developers have never been required to support multiple device resolutions in the past. But fret not, Apple has made things easy for us. Follow the four steps below and you are all set.
Step 1:
iPhone 5 requires a new instruction set, the armv7s. Only the latest Xcode, version 4.5 as on writing supports generating armv7s instruction set. Do note that, Xcode 4.5 no longer supports armv6 and deprecates iPhone 3G and older devices. So, build your app using Xcode 4.5
Step 2:
The next step is to add a launch image (Default-568h@2x.png). When you build your project with Xcode 4.5, you will see a warning, “Missing Retina 4 launch image”. Click “Add” to add a default image to your project.
The app now launches in full screen on iPhone 5 without letter boxing on iPhone 5.
Step 3:
However, most of your nib files will still not scale properly. The next step is to check your auto resizing mask of every nib file and ensure that the view inside the nib file automatically sizes based on super view’s height.
The properties that you would use are UIViewAutoresizingFlexibleTopMargin, UIViewAutoresizingFlexibleBottomMargin, UIViewAutoresizingFlexibleHeight. You use the UIViewAutoresizingFlexibleHeight for the top most view so that it autosizes with the main window. You use the UIViewAutoresizingFlexibleTopMargin and/or UIViewAutoresizingFlexibleBottomMargin for subviews.
The UIViewAutoresizingFlexibleTopMargin is used if you want the subview to be “pinned” to the bottom (top margin is flexible) and UIViewAutoresizingFlexibleBottomMargin is used if you want the subview to be “pinned” to the top (bottom margin is flexible).
When you use Cocoa Auto Layout, this step becomes optional. However, Auto Layout is not supported on iOS 5.
Step 4 (optional):
Lastly, any CALayer that you added to the view will have to be manually resized. The code below shows how to do this. I usually use a “patternLayer” to add a pattern to all of my view controllers. You should resize this in the viewWillLayoutSubviews method.
Step 5 (if you were a messy coder):
If you have hard coded the height of a view to 460 or 480, you might have to change them all using bounds. For example,
instead of
That’s it. You are all set!
http://blog.mugunthkumar.com/coding/supporting-the-iphone-5/
- Missing Retina 4 launch image(Supporting the iPhone 5)
- Designing for iPhone 4's Retina Display
- XXX iPhone has denied the launch request.
- iphone ipad默认启动图像尺寸,Default (Launch)Image
- iPhone启动图片Launch Image能玩出的花儿
- Image Processing by Retina
- iPhone: The Missing Manual: Covers the iPhone 3G
- Retina、非Retina、点、像素、iPhone分辨率
- 判断用户设备是否是 iPhone 4 Retina 屏
- 关于iPhone的Retina屏幕
- xcode 弹出的错误 1 <Xcode cannot launch apps on the simulated device “iPhone 5s”, as it is cur>
- Iphone6 launch image
- 设置Launch Image 图片
- Launch Screen Image Size
- 【iOS】Unlock iPhone to Continue Xcode cannot launch demo1_greating on iPhone because the device is lo
- iOS开发-Launch Image和Launch Screen
- Launch image or launch xib / storyboard?
- missing iso 9660 image the installer has tried to mount image #1
- as3.0 简单时间倒计时
- c 向函数传递多维数组
- 【简短笔记】MyBatis 3 使用内部缓存
- MySQL索引使用方法和性能优化
- Hibernate.initialize(Obj)用法
- Missing Retina 4 launch image(Supporting the iPhone 5)
- as3 分页代码
- Linux内核调试方法
- SqlDataAdapter对象
- IOS数据库操作SQLite3使用详解
- C# HttpWebRequest提交数据方式 .
- 获取上一次被点击的对象
- memcached java Client学习
- 七种Mysql表类型