Add shadow in tableview cell using cardView iOS swift
Solution:
Add pod specification as like below
pod 'MaterialComponents/
Then add extension of class as like below
class ShadowedView: UIView {
override class var layerClass: AnyClass {
return MDCShadowLayer.self
}
var shadowLayer: MDCShadowLayer {
return self.layer as! MDCShadowLayer
}
func setDefaultElevation() {
self.shadowLayer.elevation = .cardResting
}
}
Assign class to the view as ShadowedView then apply the code as like below
shadowView.setDefaultElevati
Comments
Post a Comment