What is the best way to create a shadow behind a UIImageView

前端 未结 4 2006
再見小時候
再見小時候 2020-11-30 18:21

I have a UIImageView that I want to add a shadow behind. I wish that apple had that as a property but they have to make lots of things hard for us programmers so I need to a

4条回答
  •  离开以前
    2020-11-30 18:39

    in additional to that, if you want to make white border and shadow you can use that code :

    //shadow part
    imageView.layer.shadowColor = [UIColor blackColor].CGColor;
    imageView.layer.shadowOffset = CGSizeMake(0, 1);
    imageView.layer.shadowOpacity = 1;
    imageView.layer.shadowRadius = 1.0;
    //white border part
    [imageView.layer setBorderColor: [[UIColor whiteColor] CGColor]];
    [imageView.layer setBorderWidth: 2.0];
    

提交回复
热议问题