iOS應用啓動頁的漸變效果

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    

   //啓動動畫

    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];


    self.window.rootViewController = [[MTTabBarViewController alloc]init];

    [self.window makeKeyAndVisible];

    

    UIImageView *splashScreen = [[UIImageView alloc] initWithFrame:self.window.bounds];

    splashScreen.image = [UIImage imageNamed:@"啓動頁.jpg"];

    [self.window addSubview:splashScreen];

    

    [UIView animateWithDuration:1.0 animations:^{

        CATransform3D transform = CATransform3DMakeScale(1.2, 1.2, 1.0);

        splashScreen.layer.transform = transform;

        splashScreen.alpha = 0.5;

    } completion:^(BOOL finished) {

        [splashScreen removeFromSuperview];

    }];

    

    return YES;

}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章