当前位置:编程学习 > wap >>

为iOS App增加启动渐变效果

由于目前苹果没有支持该功能,所以只能自己在App启动后做一个过度效果:

[cpp] 
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 

    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 
    // Override point for customization after application launch. 
    self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease]; 
    self.window.rootViewController = self.viewController; 
    [self.window makeKeyAndVisible]; 
     
    UIImageView *splashScreen = [[[UIImageView alloc] initWithFrame:self.window.bounds] autorelease]; 
    splashScreen.image = [UIImage imageNamed:@"Default"]; 
    [self.window addSubview:splashScreen];  www.zzzyk.com
     
    [UIView animateWithDuration:1.0 animations:^{ 
        CATransform3D transform = CATransform3DMakeScale(1.5, 1.5, 1.0); 
        splashScreen.layer.transform = transform; 
        splashScreen.alpha = 0.0; 
    } completion:^(BOOL finished) { 
        [splashScreen removeFromSuperview]; 
    }]; 
     
    return YES; 

补充:移动开发 , IOS ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,