Answers for "gradient color on view in swift"

1

swift uiview gradient

let view = UIView(frame: CGRect(x: 0, y: 0, width: 320, height: 50))
let gradient = CAGradientLayer()

gradient.frame = view.bounds
gradient.colors = [UIColor.white.cgColor, UIColor.black.cgColor]

view.layer.insertSublayer(gradient, at: 0)
Posted by: Guest on January-30-2021

Code answers related to "Swift"

Browse Popular Code Answers by Language