美文网首页ios积累
更改系统TabBar的高度

更改系统TabBar的高度

作者: 凤鹃一鸣 | 来源:发表于2016-12-15 11:57 被阅读28次

根据需求,修改系统TabBar的高度

在继承UITabBarController的控制器中

- (void)viewDidLayoutSubviews {

[super viewDidLayoutSubviews];

CGRect frame = self.tabBar.frame;

frame.size.height = 55;

frame.origin.y = self.view.frame.size.height - frame.size.height;

self.tabBar.frame = frame;

// self.tabBar.backgroundColor = [UIColor whiteColor];

// self.tabBar.barStyle = UIBarStyleBlack;

// 此处需要设置barStyle,否则颜色会分成上下两层

}

相关文章

网友评论

    本文标题:更改系统TabBar的高度

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