tabbar color with gradient in iOS swift

 Solution:

Code:

        let gradientLayer = CAGradientLayer()

        gradientLayer.colors = [color1.cgColorcolor2.cgColor]

        gradientLayer.startPoint = CGPoint(x: 0, y: 0.5)

        gradientLayer.endPoint = CGPoint(x: 1, y: 0.5)

        gradientLayer.frame = CGRect(x: 0, y: 0, widthtabBar.bounds.widthheighttabBar.bounds.height)

            tabBar.layer.insertSublayer(gradientLayer, at: 0)


Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift