ios设置app初始化的背景图片Launch Images
2015-10-22 22:22
726 查看
Using a Launch Screen StoryboardDEC 24TH, 2014 STORYBOARD, XCODE
Static Launch Images
Launch images are what iOS displays whilst loading an App to give the impression of a responsive system. Creating these static launch images for the growing number of screen resolutions has become something of a pain in recent years. At the time of writingthe list of possible launch image sizes is below (sizes include the status bar region). I have omitted the landscape versions for brevity:iPad 2 and iPad mini (@1x): 768 x 1024iPad and iPad mini (retina @2x): 1536 x 2048iPhone 4s (retina @2x) 640 x 960iPhone 5 (@2x): 640 x 1136iPhone 6 (@2x): 750 x 1334iPhone 6 Plus (@3x): 1242 x 2208There is some good news with Xcode 6 and iOS 8 which allow a NIB or storyboard launch screen file to be used. By taking advantage of auto layout and size classes a single NIB or storyboard file automatically creates the launch images at runtime. Notethat if you want to properly support the larger iPhone 6 and iPhone 6 Plus screen sizes in fullscreen mode without scaling you must supply the appropriate launch images either as static images of dimensions as listed above or with a storyboard launch screenfile.(Updated 26-Dec-2014: made it clearer that supporting iPhone 6 and iPhone 6 Plusrequires you to provide the launch images but they can be static image files or from a launch screen file).Using a Launch Image File
Xcode 6 adds a LaunchScreen.xib file by default to new projects. For an existing project add a new file using the Launch Screen template:Note that this will add a NIB file to the project which is fine if you have a single view or view controller on the initial launch screen. If you have multiple views you will need to ignore the launch screen template and add a storyboard. You should also specifythe launch screen file in the project settings for the target:This will add the Launch screen interface file base name (UILaunchStoryboardName) keyto the application plist file:At this point you can layout the launch view in Interface Builder using autolayout and size classes as necessary to create suitable images for each screen resolution. The Xcode template does not provide a very good example as it provides a splash screen stylelayout with the app name and copyright statement that you will probably want to delete before adding your own view layout:You can preview the storyboard in Xcode or test it in the simulator or on an actual device. Since the launch screen is only briefly displayed you may find it useful to set a breakpoint on application:didFinishLaunchingWithOptions: in the App delegate.原文:http://useyourloaf.com/blog/using-a-launch-screen-storyboard.html相关文章推荐
- 峰回路转,Firefox 浏览器即将重返 iOS 平台
- 峰回路转,Firefox 浏览器即将重返 iOS 平台
- 不可修补的 iOS 漏洞可能导致 iPhone 4s 到 iPhone X 永久越狱
- iOS 12.4 系统遭黑客破解,漏洞危及数百万用户
- 每日安全资讯:NSO,一家专业入侵 iPhone 的神秘公司
- [转][源代码]Comex公布JailbreakMe 3.0源代码
- 讲解iOS开发中基本的定位功能实现
- js判断客户端是iOS还是Android等移动终端的方法
- IOS开发环境windows化攻略
- 检测iOS设备是否越狱的方法
- .net平台推送ios消息的实现方法
- 探讨Android与iOS,我们将何去何从?
- Android、iOS和Windows Phone中的推送技术详解
- IOS 改变键盘颜色代码
- 举例详解iOS开发过程中的沙盒机制与文件
- Android和IOS的浏览器中检测是否安装某个客户端的方法
- javascript实现阻止iOS APP中的链接打开Safari浏览器
- IOS开发第三方语音-微信语音
- 解析iOS开发中的FirstResponder第一响应对象