【发布时间】:2019-10-08 08:02:25
【问题描述】:
如何去掉tab顶部的黑线,
[self.tabBar setShadowImage:[UIImage new]];
self.tabBar.backgroundImage = [UIImage new];
iOS13无效
【问题讨论】:
标签: ios objective-c uitabbar ios13
如何去掉tab顶部的黑线,
[self.tabBar setShadowImage:[UIImage new]];
self.tabBar.backgroundImage = [UIImage new];
iOS13无效
【问题讨论】:
标签: ios objective-c uitabbar ios13
您需要为 iOS 13 使用新的UITabBarAppareance
if #available(iOS 13.0, *) {
let appareance = UITabBarAppearance(barAppearance: tabBarController.tabBar.standardAppearance)
appareance.shadowImage = nil
appareance.shadowColor = nil
tabBarController.tabBar.standardAppearance = appareance
} else {
// Fallback on earlier versions.
tabBarController.tabBar.shadowImage = UIImage()
}
【讨论】: