UITableViewCell shadows

前端 未结 2 551
盖世英雄少女心
盖世英雄少女心 2021-01-15 08:47

I\'m trying to implement this design but all solutions I have browsed won\'t work and from what I understand it could be because of the spacing between the cells and the UIT

2条回答
  •  自闭症患者
    2021-01-15 09:20

    You have to make a UIView inside UITableViewCell and work on that view.

    FOR SHADOW I AM USING THIS IN UITableViewCell CLASS:-

    viewDummy.addShadow() //use from any view
    
    extension UIView {
        func addShadow(){
            self.layer.shadowColor = UIColor.blackColor().CGColor
            self.layer.shadowOpacity = 0.5
            self.layer.shadowRadius = 2.0
            self.layer.shadowOffset = CGSizeMake(1.0, 1.0)
        }
    }
    

提交回复
热议问题