美文网首页
iOS view同时加阴影和圆角

iOS view同时加阴影和圆角

作者: 麻辣小龙虾的果风 | 来源:发表于2019-06-14 10:33 被阅读0次

    怎么给view加阴影的同时增加圆角:

    顺序很重要,先加阴影后加圆角并且不切角;如:

    UIView *imgView = [[UIView alloc]init];

        imgView.backgroundColor = [UIColor whiteColor];

        imgView.layer.shadowColor = [UIColor blackColor].CGColor;

        imgView.layer.shadowRadius = 5;

        imgView.layer.shadowOffset = CGSizeMake(0, 5);

        imgView.layer.shadowOpacity = 0.3;

        imgView.layer.cornerRadius = 3;

        imgView.clipsToBounds = NO;

    相关文章

      网友评论

          本文标题:iOS view同时加阴影和圆角

          本文链接:https://www.haomeiwen.com/subject/nlylfctx.html