码迷,mamicode.com
首页 > 其他好文 > 详细

Launch Image消失时添加动画

时间:2016-08-22 18:22:14      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:

CGSize viewSize = self.window.bounds.size;
NSString *viewOrientation = @"Portrait";    //横屏请设置成 @"Landscape"
NSString *launchImage = nil;

NSArray* imagesDict = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"UILaunchImages"];
for (NSDictionary* dict in imagesDict)
{
    CGSize imageSize = CGSizeFromString(dict[@"UILaunchImageSize"]);
    
    if (CGSizeEqualToSize(imageSize, viewSize) && [viewOrientation isEqualToString:dict[@"UILaunchImageOrientation"]])
    {
        launchImage = dict[@"UILaunchImageName"];
    }
}

UIImageView *launchView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:launchImage]];
launchView.frame = self.window.bounds;
launchView.contentMode = UIViewContentModeScaleAspectFill;
[self.window addSubview:launchView];

[UIView animateWithDuration:2.0f
                      delay:0.0f
                    options:UIViewAnimationOptionBeginFromCurrentState
                 animations:^{
                     
                     launchView.alpha = 0.0f;
                     launchView.layer.transform = CATransform3DScale(CATransform3DIdentity, 1.2, 1.2, 1);
                     
                 }
                 completion:^(BOOL finished) {
                     
                     [launchView removeFromSuperview];
                     
                 }];

 

Launch Image消失时添加动画

标签:

原文地址:http://www.cnblogs.com/WJJ-Dream/p/5796268.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!