美文网首页
xib 视图居底部布局 和UITabBarController

xib 视图居底部布局 和UITabBarController

作者: 我是数据链路层 | 来源:发表于2019-03-13 09:44 被阅读0次

1.普通视图 布局居底部显示 运行时 则会距离底部有34的距离 这是因为安全区域问题禁用安全区域就行了

2.UITabBarController 设置颜色时 在x上 底部留白

这要重写tabbar的backView

UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, UI_tabBar_Height)];

    backView.backgroundColor = [UIColor whiteColor];

    [self.tabBar insertSubview:backView atIndex:0];

#define kStatusHeight [[UIApplication sharedApplication] statusBarFrame].size.height

#define UI_tabBar_Height ((kStatusHeight == 20) ? 49.0 : 83.0)

如果是刘海屏高度增加34

相关文章

网友评论

      本文标题:xib 视图居底部布局 和UITabBarController

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