从TabBar中删除第一行 [英] Remove top line from TabBar

查看:123
本文介绍了从TabBar中删除第一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS 10上,此代码无法删除tabBar阴影线:

On iOS 10 this code doesn't work in order to remove the tabBar shadow line:

[[UITabBar appearance] setShadowImage:[[UIImage alloc] init]];

有人知道,我该怎么做才能删除它?

Somebody knows, what must I do to remove it?

iOS 9.3 上,这两行删除该行,但 iOS 10 忽略 setShadowImage 命令。

On iOS 9.3 with this two lines the line is removed, but iOS 10 ignores setShadowImage command.

推荐答案

试着为 iOS 10 : -

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    [[UITabBar appearance] setBackgroundImage:[UIImage imageNamed:@"fondoTabBar"]];
    [UITabBar appearance].layer.borderWidth = 0.0f;
    [UITabBar appearance].clipsToBounds = true;
    return YES;
}

Swift 3.x

UITabBar.appearance().layer.borderWidth = 0.0
UITabBar.appearance().clipsToBounds = true

这篇关于从TabBar中删除第一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆