http://www.appcoda.com/how-to-add-splash-screen-in-your-ios-app/

What’s Splash Screen?

For those who are new to programming and haven’t heard of the term “Splash Screen”, let me first give a brief explanation about it. Splash screen is commonly found in iOS apps, as well as, other desktop applications. This is the first screen you see when launching an application. Usually, splash screen is an image covering the entire screen and disappears after the main screen is loaded. Below figure shows you a few samples of splash screen:

Sample Splash Screens / Launch Images

The primary purpose of splash screen is to let user know your app is loading and give user an introductory screen showing your brand. Splash screen is especially important for apps that take longer time to launch. Perceptually, it gives a better user experience.

Adding Splash Screen in Your App

As mentioned earlier, it’s not required to write any code to display the splash screen. iOS comes with a built-in function called launch image. This image is automatically displayed when user opens the app and disappeared until the app is fully ready to use. You can simply specify your splash screen as launch image in Xcode and it will handle the rest for you.

Preparing Your Splash Screen

As you know, iPhone 4/4S supports a higher screen resolution (what so called Retina Display). In order to support both screen resolution of older iPhone models and latest models, you have to prepare two versions of splash screen images of these sizes:

  • 320 x 480 (for iPhone 2G / 3G / 3GS)
  • 640 x 960 (for iPhone 4 / 4S)
For the sake of simplicity, I’ll show you how to add splash screen in iPhone app. In case you’re building an iPad app, you can refer to Apple’s iOS Human Interface Guideline about the launch image size and naming convention.

The splash screen image should be in PNG format. By default, you should name the image file for lower screen resolution as “Default.png”. For the image intended for Retina Display (i.e. 640 x 960 screen resolution), name the file as “Default@2x.png”. The “@2x” is a standard scale modifier used in iOS. All image files designated for displaying in Retina Display should name with the optional string “@2x”.

Instead of using “Default” as the file name of launch image, you may change it to your preferred one. The name of the launch image is defined in your app’s Info.plist file. Use our Simple Table app as an example, you can add a new property called “Launch image” in the SimpleTable-Info.plist and specify the preferred file name (say, MyLaunchImage).

The change instructs iOS to pick “MyLaunchImage.png” and “MyLaunchImage@2x.png” as launch image.

You can design your own splash screen. For testing purpose, you may download the sample splash screens.

Splash Screen for Our Simple Table App

Add Your Launch Image in Xcode

After preparing the launch image, go back to Xcode and open your Xcode project. Here we’ll continue to use our Simple Table project. Right click the “SimpleTable” project and select “Add Files to SimpleTable”. Add both “Default.png” and “Default@2x.png” to your project.

Add File to Xcode Project

If you’ve done everything correctly, you’ll see both files in your project and Xcode automatically recognizes the files as launch images.

Launch Image added in Xcode

Test it Out!

Simply run your app again. This time you’ll see a splash screen shown up instantly as it runs. For now, there is not much thing to load during application startup. (Note: the splash screen only shows up for a second and disappears.)

iphone dev 入门实例7:How to Add Splash Screen in Your iOS App的更多相关文章

  1. iphone dev 入门实例3:Delete a Row from UITableView

    How To Delete a Row from UITableView I hope you have a better understanding about Model-View-Control ...

  2. iphone dev 入门实例6:How To Use UIScrollView to Scroll and Zoom and Page

    http://www.raywenderlich.com/10518/how-to-use-uiscrollview-to-scroll-and-zoom-content Getting Starte ...

  3. iphone dev 入门实例5:Get the User Location & Address in iPhone App

    Create the Project and Design the Interface First, create a new Xcode project using the Single View ...

  4. iphone dev 入门实例4:CoreData入门

    The iPhone Core Data Example Application The application developed in this chapter will take the for ...

  5. iphone Dev 开发实例10:How To Add a Slide-out Sidebar Menu in Your Apps

    Creating the Xcode Project With a basic idea about what we’ll build, let’s move on. You can create t ...

  6. iphone dev 入门实例2:Pass Data Between View Controllers using segue

    Assigning View Controller Class In the first tutorial, we simply create a view controller that serve ...

  7. iphone dev 入门实例1:Use Storyboards to Build Table View

    http://www.appcoda.com/use-storyboards-to-build-navigation-controller-and-table-view/ Creating Navig ...

  8. iphone Dev 开发实例9:Create Grid Layout Using UICollectionView in iOS 6

    In this tutorial, we will build a simple app to display a collection of recipe photos in grid layout ...

  9. iphone Dev 开发实例8: Parsing an RSS Feed Using NSXMLParser

    From : http://useyourloaf.com/blog/2010/10/16/parsing-an-rss-feed-using-nsxmlparser.html Structure o ...

随机推荐

  1. leetcode 109 Convert Sorted List to Binary Search Tree ----- java

    Given a singly linked list where elements are sorted in ascending order, convert it to a height bala ...

  2. 4-1 yum源文件

    1.Yum源文件 <1>在Linux中,有这样一个目录 /etc/yum.repos.d/,里面有默认4个yum源文件, 其中Base是基本yum源文件,它是默认生效的 其他的几个默认都是 ...

  3. Java泛型和链表

    泛型是Java SE 1.5的新特性,泛型的本质是参数化类型,也就是说所操作的数据类型被指定为一个参数.这种参数类型可以用在类.接口和方法的创建中,分别称为泛型类.泛型接口.泛型方法. Java语言引 ...

  4. ps命令详解(转)

    原文地址:http://apps.hi.baidu.com/share/detail/32573968 有时候系统管理员可能只关心现在系统中运行着哪些程序,而不想知道有哪些进程在运行.由于一个应用程序 ...

  5. 论文笔记之:Learning to Track: Online Multi-Object Tracking by Decision Making

    Learning to Track: Online Multi-Object Tracking by Decision Making ICCV   2015 本文主要是研究多目标跟踪,而 online ...

  6. SpringMVC @Value取值(取properties属性文件的属性值)

    @Controller @RequestMapping("/reg") public class RegController extends BaseController { @V ...

  7. Oracle DBWR,LGWR,CKPT,ARCH 触发条件 总结

    一.  DBWR写磁盘数据触发条件 1. 当进程在辅助LRU链表和主LRU链表上扫描以查找可以覆盖的buffer header[空闲缓冲区]时,如果已经扫描的buffer header的数量到达一定的 ...

  8. Linux 数据流重定向

    1.三种数据流重定向1)标准输入(stdin):代码为0,使用0<或0<<,其中代码0可以省略2)标准输出(stdout):代码为1,使用1>或1>>,其中代码1可 ...

  9. 通过JavaScript更新UpdatePanel备忘

    1<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs ...

  10. EDIUS分别输出视频和音频的教程

    使用EDIUS剪辑好视频之后渲染输出文件时,为什么视频和音频分别出,而不是一起呢?这个问题很可能会让一些新手困惑不已,到底是什么原因呢?又要如何设置才能让输出的文件视音频一体呢?下面,小编将来和大家探 ...