가 그이다 :
이 (엑스 코드 버전에 제작 4.2.1)
그래서 ...
AppDelegate.h이 추가 :
@property (nonatomic, strong) UIImageView *splashView;
AppDelegate.m에 다음을 추가하십시오 :
pa의 맨 위에 cours의 ge는 splashView를 합성합니다;
: 그리고
- (void) splashFade
{
splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
splashView.image = [UIImage imageNamed:@"Default.png"];
[_window addSubview:splashView];
[_window bringSubviewToFront:splashView];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2.0];
[UIView setAnimationDelay:2.5];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:_window cache:YES];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];
splashView.alpha = 0.0;
[UIView commitAnimations];
//Create and add the Activity Indicator to splashView
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
activityIndicator.alpha = 1.0;
activityIndicator.center = CGPointMake(160, 360);
activityIndicator.hidesWhenStopped = NO;
[splashView addSubview:activityIndicator];
[activityIndicator startAnimating];
}
- (void)startupAnimationDone:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context
{
[splashView removeFromSuperview];
}
[UIView의 setAnimationDelay : 2.5]는 splashView가 선택한 지연 시간에 의해 앞에 얼마나 오래 할 책임이있다.
하면에 X/Y의 nubmers 변경하여 인디케이터의 위치를 변경할 수
activityIndicator.center CGPointMake = (160, 360); 메도에서 마침내
:
[self performSelector:@selector(splashFade) withObject:nil];
을 그리고 거기 당신은
:)이 도움이 희망 이동 :
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
그냥이를 추가합니다.
좋은 프로그래밍 되세요 ....
아직 질문하지 않았습니까? http://stackoverflow.com/questions/1404463/iphone-sdk-avoid-blank-screen-while-launching-my-application –