在程序啟動(dòng)的時(shí)候加一個(gè)動(dòng)畫!(如果你的代碼是直接在appdelegate 中寫的,直接粘貼過去就OK了,如果你單獨(dú)做了一個(gè)啟動(dòng)圖,那一樣把這段代碼粘貼過去,只需要把window換成view就Ok了!!)
CGSize viewSize = self.window.bounds.size;
NSString *viewOrientation = @"Portrait"; //橫屏請(qǐng)?jiān)O(shè)置成 @"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.8f;
launchView.layer.transform = CATransform3DScale(CATransform3DIdentity, 1.2, 1.2, 1);
}
completion:^(BOOL finished) {
[launchView removeFromSuperview];
}];
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者