Showing
2 changed files
with
8 additions
and
0 deletions
| ... | @@ -175,6 +175,7 @@ extension UIView { | ... | @@ -175,6 +175,7 @@ extension UIView { |
| 175 | gradient.colors = colours.map { $0.cgColor } | 175 | gradient.colors = colours.map { $0.cgColor } |
| 176 | gradient.locations = locations | 176 | gradient.locations = locations |
| 177 | gradient.cornerRadius = cornerRadius | 177 | gradient.cornerRadius = cornerRadius |
| 178 | + gradient.name = "linearGradientLayer" | ||
| 178 | self.layer.insertSublayer(gradient, at: 0) | 179 | self.layer.insertSublayer(gradient, at: 0) |
| 179 | } | 180 | } |
| 180 | 181 | ||
| ... | @@ -185,6 +186,7 @@ extension UIView { | ... | @@ -185,6 +186,7 @@ extension UIView { |
| 185 | gradient.startPoint = orientation.startPoint | 186 | gradient.startPoint = orientation.startPoint |
| 186 | gradient.endPoint = orientation.endPoint | 187 | gradient.endPoint = orientation.endPoint |
| 187 | gradient.cornerRadius = cornerRadius | 188 | gradient.cornerRadius = cornerRadius |
| 189 | + gradient.name = "linearGradientLayer" | ||
| 188 | self.layer.insertSublayer(gradient, at: 0) | 190 | self.layer.insertSublayer(gradient, at: 0) |
| 189 | } | 191 | } |
| 190 | } | 192 | } | ... | ... |
| ... | @@ -218,6 +218,12 @@ import SwiftEventBus | ... | @@ -218,6 +218,12 @@ import SwiftEventBus |
| 218 | questionnaireButton.layer.shadowRadius = 0.0 | 218 | questionnaireButton.layer.shadowRadius = 0.0 |
| 219 | questionnaireButton.layer.masksToBounds = false | 219 | questionnaireButton.layer.masksToBounds = false |
| 220 | } else { | 220 | } else { |
| 221 | + for layer in (questionnaireButton.layer.sublayers ?? []) { | ||
| 222 | + if(layer.name == "linearGradientLayer"){ | ||
| 223 | + layer.removeFromSuperlayer() | ||
| 224 | + } | ||
| 225 | + } | ||
| 226 | + questionnaireButton.layer.shadowOpacity = 0.0; | ||
| 221 | questionnaireButton.setTitle("+Προτιμήσεις", for: .normal) | 227 | questionnaireButton.setTitle("+Προτιμήσεις", for: .normal) |
| 222 | questionnaireButton.titleLabel?.font = UIFont.systemFont(ofSize: 13, weight: .semibold) | 228 | questionnaireButton.titleLabel?.font = UIFont.systemFont(ofSize: 13, weight: .semibold) |
| 223 | questionnaireButton.setTitleColor(UIColor(red: 0.31, green: 0.62, blue: 0.18, alpha: 1.00), for: .normal) | 229 | questionnaireButton.setTitleColor(UIColor(red: 0.31, green: 0.62, blue: 0.18, alpha: 1.00), for: .normal) | ... | ... |
-
Please register or login to post a comment