首页 > 代码库 > 背影图

背影图

  UIView *view = [[UIView alloc]initWithFrame:CGRectMake(50, 200, 100, 100)];

    view.backgroundColor = [UIColor redColor];

    view.layer.shadowOpacity = 0.8;//阴影透明度,默认0

    view.layer.shadowOffset = CGSizeMake(10,10);

    view.layer.shadowColor = [UIColor greenColor].CGColor;

    view.layer.shadowRadius = 3;//阴影半径,默认3

    [self.view addSubview:view];

 

背影图