2013-12-11 3 views
0

Мне нужно показать вкладку Bar Controller, когда анимация закончена, но я не знаю, как это сделать. Я пытаюсь с if (! AnitmationimageView.isAnimating), пока или делать пока но не работаетsplash animationimageview show tab bar

это мой код:

-(void)viewDidLoad{ 

    [self.tabBarController.tabBar setHidden:YES]; 

    AnitmationimageView.animationImages = [NSArray arrayWithObjects: 

              [UIImage imageNamed:@"splash1.jpg"], 

              [UIImage imageNamed:@"splash2.jpg"], 

              [UIImage imageNamed:@"splash3.jpg"], 

              [UIImage imageNamed:@"splash4.jpg"], nil]; 

    [AnitmationimageView setAnimationRepeatCount:1]; 

    AnitmationimageView.animationDuration = 3; 
    [self.view addSubview:Loadimageview]; 
    [self.view addSubview:AnitmationimageView]; 




    [AnitmationimageView startAnimating]; 

    //Her need something taht when animation finished show tabBar 

    [self.tabBarController.tabBar setHidden:NO]; 




    if (imagenview.frame.size.height == 432) { 
     array = [NSArray arrayWithObjects:@"[email protected]",@"[email protected]",@"[email protected]",@"[email protected]",@"[email protected]", nil]; 
    } else if (imagenview.frame.size.height == 518) { 
     array = [NSArray arrayWithObjects:@"[email protected]",@"[email protected]",@"[email protected]",@"[email protected]",@"[email protected]", nil]; 
    } 

} 

ответ

0

Решение 1:

// In the animation setup code 
[UIView setAnimationDelegate:self]; 


// this animation delegate method gets called when the animation is done. 
-(void)myAnimationStopped:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context 
{ 
    [self.tabBarController.tabBar setHidden:NO]; 
} 

Решение 2:

// In the animation setup code 
[UIView setAnimationDidStopSelector:@selector(showTabBar)]; 


// This gets called when the animation is done. 
- (void)showTabBar 
{ 
    [self.tabBarController.tabBar setHidden:NO]; 
}