我很努力地想尽全力,但我确实找不出我的代码哪里出了问题。我做了很多搜索,但我猜我只是无法理解一些Objective C的基础知识;)
我的第一个问题与下面的代码有关:
这样做有什么不同吗:
或者这样:
我的第一个问题与下面的代码有关:
[window addSubview:tabBarController.view];
UIImage *image = [UIImage imageNamed:@"lol.png"];
UIImageView *defaultImage = [[UIImageView alloc] initWithImage:image];
这样做有什么不同吗:
[window addSubview:defaultImage];
或者这样:
[tabBarController.view addSubview:defaultImage];
我的第二个问题是关于创建启动屏幕。我尝试自己做,但我就是找不出哪里出了问题(我们在appDelegate中):
[window addSubview:tabBarController.view];
UIImage *image = [UIImage imageNamed:@"lol.png"];
UIImageView *defaultImage = [[UIImageView alloc] initWithImage:image];
[window addSubview:defaultImage];
[window makeKeyAndVisible]; //makes the window visible right ?
UIImage *image2 = [UIImage imageNamed:@"lol2.png"];
UIImageView *pubImage = [[UIImageView alloc] initWithImage:image2];
[UIView setAnimationDelegate:self];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:window cache:YES]; //not sure about the forView:window ...
[defaultImage removeFromSuperview];
[window addSubview:pubImage];
[UIView commitAnimations];
嗯,我猜应该是因为我调用了“makekeyandvisible”函数,窗口才会显示出来并向用户展示动画......
好吧,我似乎还缺少一步,因为它不起作用 :D。
欢迎帮助解决问题,
Gauthier。