企升创展工作室 发表于 2012-12-19 22:17:37

优化PhoneGAP的Splashscreen

<div id="cnblogs_post_body">基于PhoneGap 2.0.0 源码版本,修改了 Commands 包下的 CDVSplashScreen 类,使用 Splashscreen的过度效果更自然,以下代码只是抛砖引玉,可以利用ios的动画库实现更多的过度动画,如:为Splashscreen增加一个按钮等。
<div class="cnblogs_Highlighter">- (void) __show:(BOOL)show{    // Legacy support - once deprecated classes removed, clean this up    id<UIApplicationDelegate> delegate = [ delegate];      if () {      id vc = ;      if (]) {            ;            ;            ;            ;
       // 动画结束后执行隐藏操作            ;            ((CDVViewController*)vc).imageView.alpha = 0.0;//让Splashscreen 的填充图片的透明度渐渐变为0;            ((CDVViewController*)vc).activityView.alpha = 0.0; //让Splashscreen 的活动视图的透明度渐渐变为0;            ;      }    }}//动画结束后隐藏Splashscreen- (void) showAnimationDone:(id*)viewController showOrhide:(BOOL)show animationID:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context{    ((CDVViewController*)viewController).imageView.hidden = !show;    ((CDVViewController*)viewController).activityView.hidden = !show;}
页: [1]
查看完整版本: 优化PhoneGAP的Splashscreen