How to give shadow like card in iOS

后端 未结 5 1052
庸人自扰
庸人自扰 2020-12-13 05:49

I would like to give shadow effect like card similar to the image in my iOS app

I need this on UITableViewCell the image will not work for me also the the g

5条回答
  •  盖世英雄少女心
    2020-12-13 06:06

        extension UIView {
    
    
              func addShadow(){
                self.layer.cornerRadius = 20.0
                self.layer.shadowColor = UIColor.gray.cgColor
                self.layer.shadowOffset = CGSize(width: 0.0, height: 0.0)
                self.layer.shadowRadius = 12.0
                self.layer.shadowOpacity = 0.7
    
             }  
    }
    

提交回复
热议问题