你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> 為iOS App增加啟動漸變效果

為iOS App增加啟動漸變效果

編輯:IOS開發綜合

由於目前蘋果沒有支持該功能,所以只能自己在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.2cto.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; 

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved