iOS 13以后, 无法直接去除tabbar上方的线条, 只能设

2022-09-09  本文已影响0人  sws1314

iOS 13以后, 无法直接去除tabbar上方的线条, 只能设置跟tabbar一样的样色,

  /// 修改线条的颜色
- (void)changeShadowImage:(BOOL)isVideo{
    if (@available(iOS 13, *)) {
        UIColor *color = [UIColor whiteColor];
        UITabBarAppearance *appearance = [self.tabBar.standardAppearance copy];
        appearance.backgroundImage = [UIImage qmui_imageWithColor:color];
        appearance.shadowImage = [UIImage qmui_imageWithColor:color];
        // 重置背景和阴影为透明  如果设置了阴影效果则此代码需要去掉
        //        [appearance configureWithTransparentBackground];
        self.tabBar.standardAppearance = appearance;
    } else {
        self.tabBar.backgroundImage = [UIImage new];
        self.tabBar.shadowImage = [UIImage new];
    }
}
上一篇 下一篇

猜你喜欢

热点阅读