首页 > 移动平台 > 详细

App开机动画

时间:2014-04-16 19:17:28      阅读:764      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
How to Add Splash Screen in Your iOS App

//
http://www.cocoachina.com/ask/questions/show/57640/%E5%BC%80%E6%9C%BA%E5%8A%A8%E7%94%BB%EF%BC%8C%E6%B8%90%E8%BF%9B%E5%8A%A8%E7%94%BB%E5%8A%A8%E7%94%BB
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
   
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    
    UIImageView *imgview=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
    
    [imgview setImage: [UIImage imageNamed:@"BG_640x960.png"]];
   
    imgview.alpha=1.0;
    
    [self.window addSubview:imgview];
    
    
    UIImageView *gifImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 114, 114)];
    NSArray *gifArray = [NSArray arrayWithObjects:[UIImage imageNamed:@"startup_loading_04_114x114.png"],
                         [UIImage imageNamed:@"startup_loading_05_114x114.png"],
                         [UIImage imageNamed:@"startup_loading_06_114x114.png"],
                         [UIImage imageNamed:@"startup_loading_01_114x114.png"],
                         [UIImage imageNamed:@"startup_loading_02_114x114.png"],
                         [UIImage imageNamed:@"startup_loading_03_114x114.png"],
                         nil];
    gifImageView.animationImages = gifArray; //动画图片数组
    gifImageView.animationDuration = 3.0; //执行一次完整动画所需的时长
    gifImageView.animationRepeatCount = 0;  //动画重复次数
    [gifImageView startAnimating];
    gifImageView.center=self.window.center;
    [self.window addSubview:gifImageView];

    [self performSelector:@selector(ViewController) withObject:nil afterDelay:3.0];
    
    return YES;
}


-(void)ViewController
{
    nav = [[UINavigationController alloc] initWithRootViewController:self.viewController];
        [self.window addSubview:nav.view];
    [self.window addSubview:tabBarController.view];
     self.window.rootViewController = nav;

    [nav release];

    wAVEYNO2ViewController =[ [WAVEYNO2ViewController  alloc] initWithNibName:@"WAVEYNO2ViewController" bundle:nil];
    [nav pushViewController:wAVEYNO2ViewController animated:YES];
}
bubuko.com,布布扣

最简单方式

iPhone开发实现splash画面非常简单,做一个全屏的欢迎页的图片,把它命名为Default.png,然后放在Xcode工程的Resource里面。 在XXXAppDelegate.m程序中,插入以下代码:

1
[NSThread sleepForTimeInterval:2.0]; //splash画面就停留2秒后消失

  

三。。。。。。

bubuko.com,布布扣
//delegate里面右个这个函数,只要它没结束,你的等待界面就不会消失。
可以在启动的时候做些动画
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    
    // Override point for customization after application launch.
    [window addSubview:viewController.view];
    [self.window makeKeyAndVisible];
    
    splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];  
    splashView.image = [UIImage imageNamed:@"Default.png"];  
    [self.window addSubview:splashView];  
    [self.window bringSubviewToFront:splashView];  
    [UIView beginAnimations:nil context:nil];  
    [UIView setAnimationDuration:2.0];  
    [UIView setAnimationTransition:UIViewAnimationTransitionNone forView: self.window cache:YES];  
    [UIView setAnimationDelegate:self];   
    [UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];  
    splashView.alpha = 0.0;  
    splashView.frame = CGRectMake(-60, -85, 440, 635);  
    [UIView commitAnimations];
    
    return YES;
}

- (void)startupAnimationDone:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
    [splashView removeFromSuperview];
    [splashView release];
}
bubuko.com,布布扣

http://www.xuebuyuan.com/1593101.html

iPhone开发之启动画面及动画

iPhone程序Splash启动画面

ios开发-自定义启动画面Default.png加载时间

http://www.codeios.com/forum.php?mod=viewthread&tid=594&page=1#pid1391

 

App开机动画,布布扣,bubuko.com

App开机动画

原文:http://www.cnblogs.com/hl666/p/3668990.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!