#pragma mark - 隐藏tabbar动画
- (void)viewWillAppear:(BOOL)animated
{
UIWindow * window = [UIApplication sharedApplication].keyWindow;
YZHTabBarController * tabbar =(YZHTabBarController *) window.rootViewController;
[UIView animateWithDuration:0.5 animations:^{
tabbar.customTabBar.alpha = 0.0;
tabbar.customTabBar.hidden = YES;
} completion:^(BOOL finished) {
}];
UIWindow * window = [UIApplication sharedApplication].keyWindow;
YZHTabBarController * tabbar =(YZHTabBarController *) window.rootViewController;
[UIView animateWithDuration:0.5 animations:^{
tabbar.customTabBar.alpha = 1.0;
tabbar.customTabBar.hidden = NO;
} completion:^(BOOL finished) {
}];
}
- (void)viewWillAppear:(BOOL)animated
{
UIWindow * window = [UIApplication sharedApplication].keyWindow;
YZHTabBarController * tabbar =(YZHTabBarController *) window.rootViewController;
[UIView animateWithDuration:0.5 animations:^{
tabbar.customTabBar.alpha = 0.0;
tabbar.customTabBar.hidden = YES;
} completion:^(BOOL finished) {
}];
}
#pragma mark - 显示动画
UIWindow * window = [UIApplication sharedApplication].keyWindow;
YZHTabBarController * tabbar =(YZHTabBarController *) window.rootViewController;
[UIView animateWithDuration:0.5 animations:^{
tabbar.customTabBar.alpha = 1.0;
tabbar.customTabBar.hidden = NO;
} completion:^(BOOL finished) {
}];
}
隐藏与显示TabBar动画
本文介绍了如何在iOS应用中实现TabBar动画的隐藏与显示,通过使用UIView动画方法,控制TabBar的alpha值和hidden属性,实现了平滑的动画效果。
4178

被折叠的 条评论
为什么被折叠?



