I have created a custom rounded floating tab bar successfully but how can i removed the default tabbar (shown with arrow in the picture). I tried to set tabbar background to UIImage() and set background color to clear but it is still not working.
My code:
let layer = CAShapeLayer()
guard let tabBar = tabBarController?.tabBar else {return}
layer.path = UIBezierPath(roundedRect: CGRect(x: 30,
y: tabBar.bounds.minY + 5,
//y: tabBar.bounds.minY - 28,
width: tabBar.bounds.width - 60,
height: tabBar.bounds.height - 24),
cornerRadius: (tabBar.frame.width / 2)).cgPath
layer.shadowColor = UIColor.lightGray.cgColor
layer.shadowOffset = CGSize(width: 5.0, height: 5.0)
layer.shadowRadius = 25.0
layer.shadowOpacity = 0.3
layer.borderWidth = 1.0
layer.opacity = 1.0
layer.masksToBounds = false
layer.fillColor = UIColor.white.cgColor
tabBar.layer.insertSublayer(layer, at: 0)
2
Answers
Use the tab bar appearance:
For All iOS Versions