iOS UITabbar去除上面横线

if (@available(iOS 13.0, *)) {
        UITabBarAppearance *appearance = [[UITabBarAppearance alloc] init];
        appearance.shadowColor = [UIColor clearColor];
        appearance.backgroundColor = [UIColor whiteColor];
        [self.tabBar setStandardAppearance:appearance];
    }else{
        //去掉top线
        self.tabBar.shadowImage = [UIImage new];
        self.tabBar.backgroundImage = [UIImage new];
        self.tabBar.backgroundColor = [UIColor whiteColor];
    }
      
    [[UITabBar appearance] setTranslucent:NO];  // view是否会延伸到最底部
    [[UITabBarItem appearance] setTitlePositionAdjustment:UIOffsetMake(0, -3)]; //设置title位置
    
    self.tabBar.layer.shadowColor = [UIColor redColor].CGColor;
    self.tabBar.layer.shadowOffset = CGSizeMake(0, -2);
    self.tabBar.layer.shadowRadius = 3;
    self.tabBar.layer.shadowOpacity = 0.05;


    self.tabBar.tintColor = [UIColor redColor]; //设置点击颜色
    if ([self.tabBar respondsToSelector:@selector(setBarTintColor:)]) {
       self.tabBar.barTintColor = [UIColor whiteColor];
    }
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。