How to give shadow like card in iOS

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

    You can give shadow effect by using this code...

    UIView *viewTemp= (UIView *)view;
    viewTemp.layer.shadowColor = [UIColor darkGrayColor].CGColor;
    viewTemp.layer.shadowOffset = CGSizeMake(0, 2);
    viewTemp.layer.shadowOpacity = 0.8;
    viewTemp.layer.shadowRadius = 3;
    viewTemp.layer.masksToBounds = NO;
    

提交回复
热议问题