任何人都可以为我提供UITabbar
顶部阴影渐变线的解决方案。我已尝试设置tabBar.shadowImage = nil
shadowImage
自定义适用于iOS 9或之前版本。但不适用于iOS 10。
答案 0 :(得分:0)
对于iOS 10
,您可以使用Application委托类方法didFinishLaunchingWithOptions
中的以下行:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[[UITabBar appearance] setBackgroundImage:[UIImage imageNamed:@"ImgName"]];
[UITabBar appearance].layer.borderWidth = 0.0f;
[UITabBar appearance].clipsToBounds = YES;
return YES;
}
可能您可以尝试下面的代码,但不建议使用私有API:
[self.tabBar setValue:@(YES) forKeyPath:@"_hidesShadow"];
Shubham bairagi 建议删除顶部阴影渐变线iOS 10
:
tabBar.subviews[0].subviews[1].isHidden = true