给iphone应用Default.png添加效果

在你的应用代理中找到application didFinishLaunching,添加以下代码:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];

//圖片擴大淡出的效果开始;

//设置一个图片;
UIImageView *niceView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
niceView.image = [UIImage imageNamed:@"Default.png"];

//添加到场景
[self.window addSubview:niceView];

//放到最顶层;
[self.window bringSubviewToFront:niceView];

//开始设置动画;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2.0];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:self.window cache:YES];
[UIView setAnimationDelegate:self];
//這裡還可以設置回調函數;

//[UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];

niceView.alpha = 0.0;
niceView.frame = CGRectMake(-60, -85, 440, 635);
[UIView commitAnimations];
[niceView release];

//结束;

return YES;
}

你可能感兴趣的:(给iphone应用Default.png添加效果)