- 浏览: 1030498 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (675)
- ios (214)
- android-course (5)
- unity3d (7)
- cocos2d (36)
- html5 (3)
- game (5)
- android (42)
- java (57)
- php (12)
- 创业 (10)
- SEO (3)
- 架构 (2)
- 数据库 (3)
- 产品设计 (9)
- 操作系统 (10)
- Web前端 (11)
- 其他 (50)
- GAE (1)
- mac os (8)
- Open Source (2)
- 序列号 (10)
- C (2)
- database (2)
- 算法 (6)
- 设计模式 (1)
- photoshop (1)
- 3dmax (1)
- maya (1)
- opengl (3)
- 游戏设计 (1)
- 趋势 (1)
- cocos2d-x (4)
- shell (3)
- c++ (30)
- lua (5)
- flash (1)
- spring (3)
- mysql (4)
- Git (6)
- xmpp (1)
- cocos2dx (14)
- mac (2)
- 编程规范 (2)
- windows (1)
- linux (5)
- coocs2dx (1)
- ubuntu (2)
- aws (1)
- OPENGLES (1)
- 原画 (1)
最新评论
-
jlees:
Best mobile app testing tool pc ...
iOS + XCode 4 + GHUnit = Mobile TDD+Continuous testing -
ipanda:
楼主,能否给一个Micro CloudFoundry的虚机或者 ...
Cloud Foundry使用及开发向导 -
love_zongming:
谢谢分享。。
visio2007序列号 -
雨花台舞水:
你这才是枪文把
套在 360 黑匣子外面的黑盒子:你被技术型枪稿吓到了么? -
hugh.wang:
改天试试
Mac版魔兽争霸3 1.24e下载
All too often an iPhone application’s launch sequence is an overlooked detail. The most common approach is to misuse the provided Default.png file as a splash screen. As it turns out, this detailing of an application is more than a little challenging if you want to get it right and stay within Apple’s guidelines.
The key to a smooth and professional looking launch sequence starts with knowing exactly where the application will land at startup. Some applications start at exactly the same place each and every successive launch, others attempt to preserve the application’s state and launch into the screen where the user last used the application. Keeping this in mind can change the strategy of how the launch sequence is implemented. This includes screen orientation as well as how and even if the status bar it to be displayed.
One may witness flickering of the status bar from blue, to black or from black to blue during the launch sequence. This is mainly due to the fact that there are two places to change the behavior of the status bar. One is hidden in the info.plist file, and the other is typically via code in the Application Delegate’s applicationDidFinishLaunching
method. Theinfo.plist
configuration is used before the main window is loaded, and the code in the Application Delegate is used during the launching of the main window. The reason one may want to utilize both styles is to take advantage of a full screen splash page, and then enable the appropriate looking status bar once the application has finished loading.
For the purpose of this example application, we will assume that the user state is preserved between executions, and we do not know exactly what the screen will look like when the user enters the application. We will therefore be implementing a full-screen splash view that will have the status bar hidden during the launch sequence. Once the splash view has disappeared, a black opaque status bar will be utilized throughout the application. It is also assumed that the application will launch in portrait mode, and that the first screen the user will see will also be in portrait mode.
Editing the Configuration File
The first order of business is to take care of the status bar. In Xcode, locate theinfo.plist
file for the project. To add an additional property to the plist file, simply select one of the entries and click on the plus tab that appears to the right and select Status Bar Style from the drop down list:
There are only three different styles to choose from. Try each style out to see which one fits the needs of the application being developed. For this example we will set the style toUIStatusBarStyleDefault
.
UIStatusBarStyles:UIStatusBarStyleDefault
— Gray (the default)UIStatusBarStyleBlackTranslucent
— Transparent black (specifically, black with an alpha of 0.5)UIStatusBarStyleBlackOpaque
— Opaque black
If on the other hand the desire is to hide the status bar when the application launches, then yet another property needs to be set. In this case, add the “Status Bar is initially hidden” property to the plist file and be sure to check the box next to the property.
Editing the Application Delegate code
So now that the status bar style is set, and initially hidden, how does one get the status bar to display again? You can actually turn the status bar on and off programmatically via code. This is particularly handy when the need arises to display a full screen view, such as the splash screen this application is utilizing. In the applicationDidFinishLaunching
method of the Application’s designated AppDelegate class, add the following line of code to make the status bar visible again:
- (void)applicationDidFinishLaunching:(UIApplication *)application { // Override point for customization after app launch [window addSubview:viewController.view]; [window makeKeyAndVisible]; [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES]; }
Adding a Default.png Image
Surprisingly, the size of this file is not as important as the naming convention of the file. Default.png is a case sensitive PNG file. The image should be 480×320 according to Apple. Following Apple’s conventions, this image should look like the view that the user will see when the application has launched, and not the actual splash screen.
Xcode provides a mechanism to create a Default.png file from an attached device running the application. From the Organizer window, select the device, click on screenshots and click capture. To make that screenshot your application’s default image, click Save As Default Image. Even though the image that is created includes the status bar as it looked when the screen shot was captured, the iPhone OS replaces it with the current status bar when your application launches. Just to be clear, this is not a splash screen…not yet.
Long Launch Sequences to Varying Views
So far, this is what most applications will implement if they implement any sort of controlled visual experience when the application launches. If you follow Apple’s guidelines, and the image you produce is the first screen that the user will see, all is good. Except, what if the launch sequence is not as fast as the user expects? What if the application preserves state and lands on a different view based on the users last know state? Then this technique is not up to the task.
Photoshop a branded image representing the application and save it as a PNG image sized at 480×320. Do not include a status bar of any kind in the image file being created. Add this image file to the project. Now the application sort of has a splash screen, through a misused implementation of the Default.png file. To correct this, simply add an image view as a property to the App Delegates header and create it as follows:
splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; splashView.image = [UIImage imageNamed:@"Default.png"]; [window addSubview:splashView]; [window bringSubviewToFront:splashView];
At this point, the image view is utilizing the exact same image file that was created in Photoshop. There’s no chance of the initial view being different than the Default.png file at this point. The one remaining problem is the timing of when to remove the image view from the subview. This can be handled in one of two ways…
Controlling the Duration of the Splash Screen
The first option is for those with quick startup times that just want a splash screen. In this situation, create a method to remove and release the splash view, then calling that method via a timed perform selector call as follows:
[self performSelector:@selector(removeSplash) withObject:nil afterDelay:1.5];
The removeSplash
method does just that, removes the image view from the subview and releases the object.
-(void)removeSplash; { [splashView removeFromSuperview]; [splashView release]; }
The second method uses the same remove splash method, but relies on the built in event management to trigger when the method gets called.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(saveClaim:) name:@"RemoveSplashScreen" object:nil];
Now all that needs to be done is to post the notification from anywhere. This technique is particularly useful if the reason that the launch sequence is taking a long time has nothing to do with code that was implemented in the App Delegate.
[[NSNotificationCenter defaultCenter] postNotificationName: @"RemoveSplashScreen" object: nil];
This technique can be employed from anywhere within the application. Removing the observer after the fact may avoid crashes if there is an opportunity for this notification to be fired multiple times. Releasing an object when no object it there to be released can lead to troublesome crashes to track down. The quick and dirty is to use the delay on theperformSelector
call.
Conclusion
And there it is, a splash screen that conforms to Apple’s guidelines. No hidden APIs, no hacks, no special sauce. A simple, straight forward approach to making the initial interaction with the user as pleasant as possible.
转自:http://gigaom.com/apple/iphone-dev-sessions-making-a-splash-screen/
发表评论
-
Mac上安装Protocol Buffers
2016-09-18 11:29 8191.下载文件 (http://code.google.com ... -
webview点击获取图片
2016-04-01 17:12 827UILongPressGestureRecognizer * ... -
hexo 自动部署脚步
2016-03-29 21:17 932echo "===============star ... -
自定义navigationItem.leftBarButtonItem后,系统默认的手势滑动失效解决方案
2016-03-01 18:01 1280自定义navigationItem.le ... -
UITextView autolayout 高度自适应
2016-02-15 23:26 1413UITextView *t = [[UITextView ... -
腾讯敏捷框架TAPD》研究
2015-11-19 20:47 1420这篇文档是研究心得 ... -
ios image 压缩
2015-11-06 12:09 837- (UIImage *)_scaleToSize:(UII ... -
iphone分辨率图解
2015-11-04 17:33 565iphone分辨率图解 -
IOS中获取各种文件的目录路径的方法
2015-09-24 12:10 646iphone沙箱模型的有四个文件夹,分别是什么,永久数据存储 ... -
Customizing Navigation Bar and Status Bar in iOS 7
2015-08-17 20:23 1606Like many of you, I have been ... -
GCD 深入理解:第一部分
2015-07-24 14:49 767本文翻译自 http://www.raywenderlich ... -
Mac上的抓包工具Charles
2015-05-06 01:09 5316Mac上的抓包工具Charles 分类: IO ... -
如何移除发布版本中的NSLog输出
2015-05-04 20:27 747Phone开发中会经常使用NSLog将一些运行信息输出到终端 ... -
xcode4的环境变量,Build Settings参数,workspace及联编设置
2015-03-27 11:23 924一、xcode4中的环境变量 $(BUILT_PROD ... -
数字签名是什么?
2014-11-25 16:58 615http://www.ruanyifeng.com/blog/ ... -
让你的Xcode更加高效
2014-10-29 00:16 516http://www.tairan.com/archives/ ... -
我所经历的“余额宝”的那些故事
2014-06-08 01:05 757“余额宝”经过不到 ... -
代码手写UI,xib和StoryBoard间的博弈,以及Interface Builder的一些小技巧
2014-05-31 01:25 793最近接触了几个刚入门的iOS学习者,他们之中存在一个普遍 ... -
WWDC 2013 Session笔记 - iOS7中的多任务
2014-05-31 01:24 660这是我的WWDC2013系列笔记中的一篇,完整的笔记列表 ... -
APP被苹果App Store拒绝的79个原因(未完待续)
2014-05-09 10:49 1147作为iOS开发者,估计有很多都遇到过APP提交到App Sto ...
相关推荐
届会Web服务的常规会话模块特征异步/等待简单的自定义存储将值存储在基于serde_json的例子sessions = { version = " 0.1 " , features = [ " memory " ] } use std :: sync :: Arc;use sessions :: * ;let config = ...
会话 用于会话管理的Gin中间件,具有多后端支持:用法开始使用它下载并安装: $ go get github.com/gin-contrib/sessions 将其导入您的代码中: import "github.com/gin-contrib/sessions"基本范例单节package main...
store := sessions . NewCookieStore ([] byte ( "secret123" )) g . Use ( sessions . Middleware ( "my_session" , store )) g . GET ( "/set" , func ( c * gin. Context ){ session := sessions . Get ( c
OSC19-Linux-Workshop-Sessions:所有以.md和.pdf格式的OSC'19研讨会。
在IT行业中,"weekly_sessions"通常指的是某个项目或系统中记录用户周度活动或会话的数据集合。这个压缩包文件“weekly_sessions-master”可能包含了一系列与用户行为分析、数据分析或者性能监控相关的数据文件。让...
会话数据存储在“会话”属性中的请求对象上: var connect = require('connect'), sessions = require('cookie-sessions');Connect.createServer( sessions({secret: '123abc'}), function(req, res, next){ req....
**标题解析:** "TF_Training_Sessions:TF培训课程笔记本" 暗示这是一个关于TensorFlow训练课程的集合,其中包含一系列的教程或实践项目。"TF"是TensorFlow的缩写,这是一个广泛使用的开源机器学习框架,由Google...
会议会话类型解释器实现。 main.go 是样板代码,现在等待解析器的未来实现。 expr.y 是一种玩具示例语言的 goyacc 实现,可以作为解析器未来实现的基础。 在这一点上,大多是废代码。 会话程序的有趣代码在escapes....
store := sessions . NewCookieStore ([] byte ( "secret123" )) m . Use ( sessions . Sessions ( "my_session" , store )) m . Get ( "/set" , func ( session sessions. Session ) string { session . Set ...
django-dynamodb-sessions 信息: 该软件包包含一个简单的Django会话后端,该后端使用Amazon的进行数据存储。 作者: 格雷格·泰勒(Greg Taylor) 地位: 稳定但未维护(如果有兴趣维护,请打开一个问题!) ...
UC Phone Proxy Sessions : 2 perpetual Total UC Proxy Sessions : 2 perpetual Botnet Traffic Filter : Enabled perpetual Intercompany Media Engine : Disabled perpetual Cluster : Disabled perpetual
sess := sessions . Start ( http . ResponseWriter , * http . Request ) sess . ID () string Get ( string ) interface {} HasFlash () bool GetFlash ( string ) interface {} GetFlashString ( string ) ...
MemoryStore {}var Sessions = sessions . NewSessionOptions ( secret , & inMemorySessionStore ) 使用Redis(使用fzzy/radix): var redisSessionStore = sessions . NewRedisStore ( "tcp" , "localhost:6379...
会话练习 介绍 会话重建,也称为会话化,是一... 计算的访问会话必须写入名为sessions.csv的文件中,文件中的每一行必须具有以下格式: IP_ADDRESS,SESSION_START,SESSION_END 在哪里: IP_ADDRESS是客户端的 IP 地
本教程“Git-GitHub-Sessions”旨在引导新手掌握Git的基本操作,并学会在GitHub上进行协作,特别是如何创建Pull Request (PR)。 Git是一种分布式版本控制系统,它允许开发者追踪代码更改、协同工作,并在多个版本...
for session in user_sessions: session.expire() session.save() ``` 总之,`django-user-sessions`为Django提供了强大的会话管理功能,它增强了对用户会话的控制,使开发者能够更好地管理和监控用户的行为。这...
在这个主题下,“WebOps-Sessions”可能是一系列关于如何在WebOps环境下进行有效演讲的讨论或教程。在进行会议演讲时,尤其在IT领域,了解JavaScript这一重要的前端编程语言是非常关键的,因为它在构建交互式和动态...
系统还将一些统计信息提供到/ sys / kernel / session-module目录中,用户可以在其中: *See the number of total open sessions*See the number of sessions per-process and per-file*See and change the path ...
在IT领域,"Breakout-sessions"通常指的是在会议、研讨会或培训中,参与者分成小组进行深入讨论或实践活动的部分。这种形式有助于增强参与者的互动性和深度学习。在本例中,"Breakout-sessions"可能是指一个项目或...
const StoreSession = require ( "mongoose-express-sessions" ) ( session ) mongoose . connect ( ) app . use ( session ( { secret : 's3cr37' , cookie : { maxAge : 1000 * 60 * 60 * 24 * 7 } , store : ...