iOS|iOS uiview 简单加阴影

UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(20, 20, 280, 300)];

【iOS|iOS uiview 简单加阴影】//[containerView.layer setCornerRadius:5];
containerView.backgroundColor = [UIColor greenColor];
containerView.layer.shadowOffset = CGSizeMake(0, 2);
containerView.layer.shadowOpacity = 0.80;
[self.view addSubview:containerView];

    推荐阅读