博客> About tabbar
About tabbar
2017-08-13 17:09 评论:0 阅读:230 vistatinchao
ios tabbar 高度

pragma mark 布局子控件

  • (void)setItemFrame {

    CGFloat buttonY=0; CGFloat buttonW = Screen_Width/5.0; CGFloat buttonH = self.height; NSInteger index = 0; NSLog(@"%@",self.subviews); for (UIView button in self.subviews) { if ([button isKindOfClass:[UIControl class]]) { CGFloat buttonX = buttonW index; button.frame = CGRectMake(buttonX, buttonY, buttonW, buttonH); index++; }

    } } 2.重写UITabBarController的UITabBarController方法

  • (void)viewWillLayoutSubviews{ CGRect tabFrame = self.tabBar.frame; //self.TabBar is IBOutlet of your TabBar tabFrame.size.height = 80; tabFrame.origin.y = self.view.frame.size.height - 80; self.tabBar.frame = tabFrame; }
收藏
1
sina weixin mail 回到顶部