RDVTabBarController icon indicating copy to clipboard operation
RDVTabBarController copied to clipboard

Why tabbarHeight 58.f?

Open lyricdon opened this issue 5 years ago • 2 comments

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;
    }

lyricdon avatar Nov 29 '18 07:11 lyricdon

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

zhangqi02060227m avatar Jan 05 '19 08:01 zhangqi02060227m

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。

wangfei525 avatar Jun 14 '23 02:06 wangfei525