iOS view同时加阴影和圆角

怎么给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同时加阴影和圆角)