i have 6 button on view 2 pair of 2 grid.the problem how show button animation, here attach example url how create type of animation. in example when click on menu button show button in side menu view animation https://github.com/djardon/sidemenufrostedanimated tried can't success. have 2 button 1 btnhome , second btnabout:
-(void)animationstart { [btnhome setalpha:0.f]; [uiview animatewithduration:1.f delay:0.f options:uiviewanimationoptioncurveeasein animations:^{ [btnhome setalpha:0.f]; } completion:^(bool finished) { [uiview animatewithduration:2.f delay:0.f options:uiviewanimationoptioncurveeaseinout animations:^{ [btnhome setalpha:1.f]; [self animationstart2]; } completion:nil]; }]; } -(void)animationstart2 { [btnabout setalpha:0.0f]; //fade in [uiview animatewithduration:2.0f animations:^{ [btnabout setalpha:1.0f]; } completion:^(bool finished) { //fade out [uiview animatewithduration:2.0f animations:^{ [btnabout setalpha:0.0f]; } completion:nil]; }]; }
try this.
- (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. btnhome.alpha=0.0; btnabout.alpha=0.0; } -(void)animationstart { [uiview animatewithduration:0.4f delay:0.0f options: uiviewanimationoptioncurveeaseinout animations:^{ btnhome.alpha=1.0; } completion:^(bool finished) { [self animationstart2]; }]; } -(void)animationstart2 { [uiview animatewithduration:0.4f delay:0.0f options: uiviewanimationoptioncurveeaseinout animations:^{ btnabout.alpha=1.0; } completion:^(bool finished) { }]; } - (ibaction)btnclick:(id)sender { [self animationstart]; } here setting buttons alpha value 0.0f. on click of third button showing these 2 buttons.
Comments
Post a Comment