Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why tabbarHeight 58.f? #95

Open
lyricdon opened this issue Nov 29, 2018 · 2 comments
Open

Why tabbarHeight 58.f? #95

lyricdon opened this issue Nov 29, 2018 · 2 comments

Comments

@lyricdon
Copy link

tabBarHeight is fixed to 58.f

so my code [self.tabBar setHeight:49 + bottomHeight] mean nothing

Steps to Reproduce

CGSize viewSize = self.view.bounds.size;
CGFloat tabBarStartingY = viewSize.height;
CGFloat contentViewHeight = viewSize.height;
CGFloat tabBarHeight = CGRectGetHeight([[self tabBar] frame]);

if (!tabBarHeight) {
    if (@available(iOS 11.0, *)) {
        CGFloat safeAreaBottom = UIApplication.sharedApplication.keyWindow.safeAreaInsets.bottom;
        tabBarHeight = 58.f + safeAreaBottom / 1.5f;
    } else {
        tabBarHeight = 58.f;
    }
} else if (@available(iOS 11.0, *)) {
    CGFloat safeAreaBottom = UIApplication.sharedApplication.keyWindow.safeAreaInsets.bottom;
    tabBarHeight = 58.f + safeAreaBottom / 1.5f;
}

do like this?

else if (@available(iOS 11.0, *)) {
        CGFloat safeAreaBottom = UIApplication.sharedApplication.keyWindow.safeAreaInsets.bottom;
        tabBarHeight = tabBarHeight + safeAreaBottom / 1.5f;
    }
@zhangqi02060227m
Copy link

我也有同样的问题。。。。 高度不应该是 49.f + sefeBottom。。 而且dome tabBar 没有适配安全区。。。

@wangfei525
Copy link

I have the same problem,tabbar setHeight only set current frame,after switch tab,the height of tabbar still equal tabBarHeight + safeAreaBottom / 1.5f。in order to set height of tabbar,we can create a new class which Inherited from RDVTabBarController and rewrite method viewDidLayoutSubviews。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants