美文网首页
tabbar动画显示

tabbar动画显示

作者: huicuihui | 来源:发表于2018-03-06 11:22 被阅读5次
- (void)showTabBarWithAnimationDuration:(CGFloat)durationTime
{
    UITabBar *tabBar = self.tabBarController.tabBar;
    UIView *parent = tabBar.superview; // UILayoutContainerView
    UIView *content = [parent.subviews objectAtIndex:0];  // UITransitionView
    UIView *window = parent.superview;
    
    [UIView animateWithDuration:durationTime
                     animations:^{
                         CGRect tabFrame = tabBar.frame;
                         tabFrame.origin.y = CGRectGetMaxY(window.bounds) - CGRectGetHeight(tabBar.frame);
                         tabBar.frame = tabFrame;
                         
                         CGRect contentFrame = content.frame;
                         contentFrame.size.height -= tabFrame.size.height;
                     }];
    
}

相关文章

网友评论

      本文标题:tabbar动画显示

      本文链接:https://www.haomeiwen.com/subject/jkulfftx.html