How to give shadow like card in iOS

后端 未结 5 1027
庸人自扰
庸人自扰 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:08

    Maybe someone needs Swift version

    func setCardView(view : UIView){
    
            view.layer.masksToBounds = false
            view.layer.shadowOffset = CGSizeMake(0, 0);
            view.layer.cornerRadius = 1; 
            view.layer.shadowRadius = 1;
            view.layer.shadowOpacity = 0.5;
    
        }
    

提交回复
热议问题