視圖陰影主要透過 layer 設定。
imgView.layer.shadowColor = [UIColor blackColor].CGColor;
imgView.layer.shadowOpacity = 0.8f;
imgView.layer.shadowRadius = 4.f;
imgView.layer.shadowOffset = CGSizeMake(4, 4);

即使偏移為 (0, 0),仍可能看到四周陰影。

若需要更精準的效能與外觀,可設定 shadowPath:
UIBezierPath *path = [UIBezierPath bezierPath];
// 依需求繪製路徑
imgView.layer.shadowPath = path.CGPath;
