iOS13 UITabBar系统
iOS13 system UITabBar
如何去除选项卡顶部的黑线,
[self.tabBar setShadowImage:[UIImage new]];
self.tabBar.backgroundImage = [UIImage new];
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()
}
如何去除选项卡顶部的黑线,
[self.tabBar setShadowImage:[UIImage new]];
self.tabBar.backgroundImage = [UIImage new];
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()
}