Last active
December 22, 2021 03:16
-
-
Save hanfengs/adce89c93b240c99c163a6a9023377f5 to your computer and use it in GitHub Desktop.
[swift渐变色] #swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let layer = CAGradientLayer() | |
layer.frame = self.tabBarBottomView.bounds | |
layer.startPoint = CGPoint.zero | |
layer.endPoint = CGPoint(x: 0, y: 1) | |
layer.colors = [UIColor(red: 78, green: 78, blue: 78, transparency: 0).cgColor, UIColor(red: 0, green: 0, blue: 0, transparency: 0.5).cgColor] | |
self.tabBarBottomView.layer.addSublayer(layer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment