UITabBar去除顶部横线

SMTabBar *tabbar = [SMTabBar new];
tabbar.tintColor = SkinColor(ZWTTabBarTextSelectColorKey);
tabbar.barTintColor = [UIColor whiteColor];
tabbar.delegate = self;
[self setValue:tabbar forKey:@"tabBar"];


// UITabBar去除顶部横线
UITabBar *tabBar = [UITabBar appearance];
[tabBar setBackgroundColor:[UIColor whiteColor]];
[tabBar setBackgroundImage:[UIImage new]];
[tabBar setShadowImage:[UIImage new]];
    
if (@available(iOS 13.0, *)){
    UITabBarAppearance* tabBarAppearance = [[UITabBarAppearance alloc] init];
    tabBarAppearance.shadowColor = [UIColor clearColor];
    [tabBar setStandardAppearance:tabBarAppearance];
}

你可能感兴趣的:(UITabBar去除顶部横线)