iOS view圆角加阴影

UIView *view=[[UIView alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];
      view.backgroundColor=[UIColor yellowColor];
       //v.layer.masksToBounds=YES;这行去掉
      view.layer.cornerRadius=10;
      view.layer.shadowColor=[UIColor redColor].CGColor;
      view.layer.shadowOffset=CGSizeMake(0, 0);
      view.layer.shadowOpacity=0.5;
      view.layer.shadowRadius=5;
      [self.view addSubview:view];

你可能感兴趣的:(iOS view圆角加阴影)